gtfs-rest is Python3/Flask application for serving GTFS data over a REST API.
The current API design is geared heavily toward the needs of Web Transit Map, however a long-term goal is to make gtfs-rest general stable interface for GTFS data that can hopefully be used as the basis for other web and mobile applications.
- python3 >= 3.6
- python3-flask
- sqlite3
-
Retrieve a GTFS archive for your transit agency(s) from your city or a provider such as transitfeeds.com
-
Import the transit data into an sqlite database using
gtfs_import.py
./gtfs_import.py -i path/to/gtfs.zip -o my-city-gtfs.db
-
Copy and edit the configuration file config.sample.py to config.py.
- Update 'DATABASE' setting to reflect the path of your sqlite database
-
Execute
./run
if not running in production, otherwise deploy the flask application as appropriate for your environment -
Optionally, setup Web Transit Map which utilizes gtfs-rest
The API is currently unstable so there is no solid documentation aside from the
source code. Please view @app.route()
decorators in gtfs_server.py
for the time being.