OpenTransitTools / gtfsdb_realtime

Real-time GTFS database loader and ORM library.
Other
11 stars 1 forks source link

GTFSDB Realtime

Supported Databases

GTFS REALTIME (General Transit Feed Specification) Database

Python code that will load GTFS-realtime data into a relational database, and SQLAlchemy ORM bindings to the GTFS tables in the gtfsdb. See https://developers.google.com/transit/gtfs-realtime/

Install and use via the gtfsdb source tree:

  1. Install Python 2.7, easy_install and buildout on your system...
  2. git clone https://github.com/OpenTransitTools/gtfsdb_realtime.git
  3. cd gtfsdb_realtime
  4. buildout (note: if you're using postgres, do a 'buildout install prod pg')

Run TriMet example:

  1. get a TriMet api key: http://developer.trimet.org/appid/registration/
  2. bin/gtfsdb-rt-loader -a TRIMET -d postgresql+psycopg2://ott@127.0.0.1:5432/ott --apikey -c ### NOTE: create rt tables and populate all services
  3. bin/gtfsdb-rt-loader -a TRIMET -d postgresql+psycopg2://ott@127.0.0.1:5432/ott --api_key -t None -v null ### NOTE: just update the Alerts data (skip trip and vehicle updates)

TODO: to get the route_short_names into the db right now (for alerts), have to run -c (create tables) cd ~/loader; bin/gtfsrt-load -d loc -a trimet -ak B393B2CE96A258A72BAB481CA -turl null -c