GTFS API proposal #2
-
Regarding the issue #32, I've thought a bit about how the GTFS API could be done. GTFS is specified as a zip file containing csv / txt files, so by providing the data as json or similar formats is counter to the GTFS specifcation. If we want to transfer GTFS into JSON, there are already existing projects, but nothing that sees too much active development. Nevertheless, having something a bit more fancy than an S3 bucket could be useful, if only to have some metadata, and have the whole thing in one place instead of a bunch of S3 links. I don't know how common it is to request single files outside of the zip, so if we don't need that, the service could be even simpler:
The datasets themselves could be configured in a *.yml file following this rough outline:
I think this way we could provide useful additional information / metadata, and aid discovery by providing a single access point. If we want to extend this in the future, we can add JSON format by doing /json instead of /raw, or by respecting the Accept header MIME type (e.g. if someone requests JSON, they get JSON, otherwise zip/txt) Let me know what you think |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 3 replies
-
@clezag I think this is OK. Typically GTFS Data Consumer do want directly the ZIP, so I would go for an MVP in which you can simply download to a proper API call the ZIP file. Question: do we want to store all GTFS ZIP files generated and provide them as well? |
Beta Was this translation helpful? Give feedback.
-
A MVP of this is now up in testing: https://gtfs.api.opendatahub.testingmachine.eu/v1/dataset Configuration of the datasets is done via datasets.yml in the repo |
Beta Was this translation helpful? Give feedback.
-
Regarding storing the history etc: Currently this is a very minimal system: If we want to have history, lots of files, changing metadata etc. then we have to connect this to a database, extend the schema to support it, decide how we want to store the binary files (we currently don't, I think) So it would become a much more serious project than it is now. |
Beta Was this translation helpful? Give feedback.
@clezag I think this is OK. Typically GTFS Data Consumer do want directly the ZIP, so I would go for an MVP in which you can simply download to a proper API call the ZIP file. Question: do we want to store all GTFS ZIP files generated and provide them as well?