Topic: data-formats
-
Choosing a configuration format: JSON, YAML or TOML
JSON is strict and universal but has no comments; YAML is readable but has surprising implicit typing; TOML is explicit and comment-friendly for flat-to-moderate structures. Pick by who edits the file and what parses it.
-
Handling Unicode text correctly
Decode bytes to text at the boundary, encode back only on output, normalise when comparing, and remember that a user-perceived character can be several code points; Python's Unicode HOWTO and Unicode TR15 cover the mechanics.
-
Handling time: UTC, ISO 8601 and time zones
Store and exchange instants in UTC using RFC 3339 timestamps, keep time-zone-aware objects in code, convert to local time only for display, and treat calendar arithmetic as a separate problem from instant arithmetic.
Machine-readable: JSON