to_canonical_system_information(raw: dict, *, system_id: str | None = None) -> dict[str, Any]
Parse system_information.json into a small dict of system metadata.
Crucially exposes timezone (e.g. "Europe/Paris") so UTC frames can be
converted to local diurnal time without a manual lookup per city.
See Also
to_canonical_system_regions : The matching regions parser.
GBFSFeed : The feed that calls these parsers.
Source code in src/gbfs_toolkit/io/normalize.py
| def to_canonical_system_information(raw: dict, *, system_id: str | None = None) -> dict[str, Any]:
"""Parse ``system_information.json`` into a small dict of system metadata.
Crucially exposes ``timezone`` (e.g. ``"Europe/Paris"``) so UTC frames can be
converted to local diurnal time without a manual lookup per city.
See Also
--------
[`to_canonical_system_regions`][gbfs_toolkit.to_canonical_system_regions] : The matching regions parser.
[`GBFSFeed`][gbfs_toolkit.GBFSFeed] : The feed that calls these parsers.
"""
data = raw.get("data", raw)
if not isinstance(data, dict):
data = {}
return {
"system_id": str(data.get("system_id") or system_id or ""),
"name": _name(data.get("name")),
"timezone": data.get("timezone"),
"language": data.get("language") or (data.get("languages") or [None])[0],
"operator": _name(data.get("operator")),
"url": data.get("url"),
}
|