Repository navigation
Conversation
Add published GBFS feeds to feeds_v2.csv as data_type=gbfs rows using the existing columns: urls.direct_download is the auto-discovery URL and the bounding box comes from gbfsfeed.bounding_box / bounding_box_generated_at. GTFS-only columns (entity_type, static_reference, urls.latest, features) are left empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The change alters the public feeds_v2.csv contract and redefines direct_download for a new feed class, so downstream compatibility and rollout expectations require maintainer confirmation.
No open issues 🎉
What changed in this PR
Adds published GBFS feeds to the public feeds_v2.csv export alongside GTFS and GTFS-Realtime feeds, including location, provider, auto-discovery URL, license, status, and bounding-box data.
Changes:
- Adds batched retrieval of published GBFS feeds with extracted-location support.
- Maps GBFS metadata, auto-discovery URLs, locations, and bounding boxes into CSV rows.
- Extends fixtures, expected output, and README documentation for GBFS support.
Review note: Nit: Update docs/SpreadsheetSchemaV2.md to document the new gbfs data type and its populated and empty fields.
| File | Description |
|---|---|
functions-python/export_csv/tests/test_export_csv_main.py |
Adds expected GBFS CSV rows and verifies unpublished feeds are excluded. |
functions-python/export_csv/tests/conftest.py |
Seeds published and unpublished GBFS fixtures with location and bounding-box variations. |
functions-python/export_csv/src/main.py |
Processes GBFS feeds and formats their metadata and bounding boxes for export. |
functions-python/export_csv/README.md |
Documents GBFS as an exported feed type. |
api/src/shared/common/db_utils.py |
Adds batched GBFS feed retrieval matching the existing GTFS export workflow. |
Review effort: Lite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Adds published GBFS feeds to the CSV export (
feeds_v2.csv) asdata_type=gbfsrows, so people can find bike, scooter and car share systems by location without an API token, the same way the CSV already works for GTFS. The database already has what's needed: GBFS feeds carry a bounding box, locations and the auto-discovery URL.get_all_gbfs_feeds()inshared/common/db_utils.py, mirroringget_all_gtfs_feeds()(batched, streamed, samepublished_onlyand extracted-location passes).get_gbfs_feed_csv_data()inexport_csv, reusingget_feed_csv_data()for the common columns:urls.direct_downloadis the auto-discovery URL (gbfs.json), i.e. the feed'sproducer_url.gbfsfeed.bounding_box, withbounding_box_generated_atasextracted_on. That column is stored without a time zone, so it's marked as UTC to match the GTFS rows' format.entity_type,static_reference,urls.latest,features) stay empty, as they already are for the types they don't apply to.gbfsrows indocs/SpreadsheetSchemaV2.md.Compatibility: no columns are added, removed or reordered, but the file gains a third
data_type. Consumers that assume onlygtfs/gtfs_rtrows, or thaturls.direct_downloadis always a zip, would see the new rows. If you'd prefer to keepfeeds_v2.csvunchanged, the same rows could go to a separate file instead; happy to rework it that way.Context: I'm adding Home Assistant integrations for GTFS and GBFS that use this catalog to discover feeds near a user's home. GTFS discovery works from the public CSV today; GBFS currently needs the authenticated API.
Expected behavior:
feeds_v2.csvcontains one row per published GBFS feed, sorted with the others by id, with the location, provider, auto-discovery URL, license, status and bounding box filled in. Unpublished GBFS feeds are excluded.Testing tips:
scripts/api-tests.sh --folder functions-python/export_csv. The fixtures add three GBFS feeds: one published with a bounding box and an extracted location, one published without either, and one unpublished that must not appear../scripts/api-tests.shto make sure you didn't break anything🤖 Generated with Claude Code