GBFSFeed¶
GBFSFeed
¶
GBFSFeed(gbfs_url: str | None = None, *, language: str | None = None, system_id: str = 'system', timeout: int = 30, get_json: JsonGetter | None = None)
A friendly handle on one GBFS system: discover once, fetch tidy frames.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gbfs_url
|
str
|
URL of the system's |
None
|
language
|
str
|
Preferred language key for multi-language (GBFS 2.x) feeds. |
None
|
system_id
|
str
|
Stamped on every returned frame (defaults to |
'system'
|
timeout
|
int
|
|
30
|
get_json
|
callable
|
|
None
|
See Also
fetch_feed_json : Fetch a single GBFS document.
audit_feed : Audit a fetched feed end to end.
build_availability_panel : Build a panel from fetched snapshots.
Source code in src/gbfs_toolkit/io/fetch.py
language
property
writable
¶
Preferred feed language (GBFS 2.x). Setting it re-discovers the feeds.
ttl
property
¶
Advertised refresh interval (seconds) from gbfs.json; feeds the staleness audit.
last_updated
property
¶
last_updated: Timestamp
When the discovery document was last updated (tz-aware UTC), or NaT.
timezone
property
¶
IANA timezone (e.g. "Europe/Paris") from system_information, for local time.
from_system_id
classmethod
¶
Build a feed by resolving system_id through the MobilityData catalogue.
Source code in src/gbfs_toolkit/io/fetch.py
has
¶
vehicles
¶
vehicles() -> DataFrame
Canonical free-floating vehicle positions (vehicle_status/free_bike_status).
vehicle_types
¶
vehicle_types() -> DataFrame
Canonical vehicle_types catalogue (form factor / propulsion / range).
geofencing_zones
¶
Operator-defined service-area polygons as a GeoDataFrame ([geo] extra).
Raises KeyError if the system publishes no geofencing_zones feed; check
has first. See to_canonical_geofencing.
Source code in src/gbfs_toolkit/io/fetch.py
system_regions
¶
system_regions() -> DataFrame
Canonical region_id → name lookup (raises if the feed has no system_regions).
Source code in src/gbfs_toolkit/io/fetch.py
alerts
¶
alerts() -> DataFrame
Canonical service alerts (raises if the feed has no system_alerts).
Source code in src/gbfs_toolkit/io/fetch.py
system_information
¶
System metadata (name, timezone, language, operator), cached.
Source code in src/gbfs_toolkit/io/fetch.py
availability
¶
availability() -> DataFrame
The daily one-liner: live status joined with station info.
Thin convenience over join_availability; returns bikes/docks
and name, coordinates, capacity and station type in one tidy frame (outer join with a
presence indicator). For offline frames (e.g. from a Parquet lake), call
join_availability(info, status) directly.
Source code in src/gbfs_toolkit/io/fetch.py
to_local_time
¶
Convert UTC timestamp columns to the system's local timezone (diurnal analysis).
Source code in src/gbfs_toolkit/io/fetch.py
audit
¶
audit() -> DataFrame
Unified semantic audit: static (A1–A7) on the inventory and dynamic
(D1–D3) on live availability, stacked with an audit_type column.
Thin convenience over audit_frames (dynamic staleness uses the
feed's advertised ttl). For offline frames, call audit_frames(info, status).
Source code in src/gbfs_toolkit/io/fetch.py
reconcile_fleet
¶
reconcile_fleet() -> Series
One authoritative fleet tally across the docked and free-floating feeds.
Pulls station_status and/or vehicle_status (whichever exist) and reconciles
them, excluding vehicles parked at stations from the deployed total so the two feeds
don't double-count. See reconcile_fleet_state.
Source code in src/gbfs_toolkit/io/fetch.py
snapshot
¶
snapshot() -> dict[str, DataFrame]
All available tidy frames at once: information, status (+ vehicles).
Source code in src/gbfs_toolkit/io/fetch.py
summary
¶
summary() -> Series
A one-glance health card: counts, staleness, version; ideal in a notebook.