GithubHelp home page GithubHelp logo

fabmazz / gtfs_realtime_json Goto Github PK

View Code? Open in Web Editor NEW

This project forked from harrytruong/gtfs_realtime_json

0.0 2.0 0.0 4.55 MB

Standalone utility to convert gtfs-realtime feeds into simple JSON.

License: MIT License

Python 98.43% Shell 1.57%

gtfs_realtime_json's Introduction

gtfs_realtime_json

Standalone utility to convert gtfs-realtime feeds into simple JSON (and backward).

Download

Usage

$ gtfs_realtime_json <feed_url>

Examples:

$ gtfs_realtime_json "http://api.bart.gov/gtfsrt/tripupdate.aspx"
{"header":{"gtfs_realtime_version":"1.0","timestamp":1424843250, ... }

$ gtfs_realtime_json "http://api.bart.gov/gtfsrt/tripupdate.aspx" > output.json
// save JSON to output.json file

Sample JSON Outputs:

  • MTA Trip Update json
  • BART Trip Update json

Converting a JSON to a protobuf file

First create a virtualenv:

$ mkvirtualenv gtfs_realtime_json
$ pip install -r requirements.txt

Then each time simply:

$ workon gtfs_realtime_json
$ ./json_gtfs_realtime.py file:gtfsrt.json gtfsrt.pb

GTFS-realtime Feed Sources

If you have any updates to this list, please message me or submit a PR!

Last Updated: 02-25-2015

Working Feeds:

  • MTA (link)

    • Trip Updates (1, 2, 3, 4, 5, 6, S lines):
      http://datamine.mta.info/mta_esi.php?key=<key>&feed_id=1
    • Trip Updates (L line):
      http://datamine.mta.info/mta_esi.php?key=<key>&feed_id=2
    • Trip Updates (Staten Island Railway):
      http://datamine.mta.info/mta_esi.php?key=<key>&feed_id=11
    • Note: NYCT's custom gtfs-realtime extensions have been included.
    • Note: An API key is required for these feeds.
  • ART (link)

    • Trip Updates:
      http://realtime.commuterpage.com/rtt/public/utility/gtfsrealtime.aspx/tripupdate
  • MBTA (link)

    • Service Alerts:
      http://developer.mbta.com/lib/GTRTFS/Alerts/Alerts.pb
    • Trip Updates:
      http://developer.mbta.com/lib/GTRTFS/Alerts/TripUpdates.pb
    • Vehicle Positions:
      http://developer.mbta.com/lib/GTRTFS/Alerts/VehiclePositions.pb
  • BART (link)

    • Service Alerts:
      http://api.bart.gov/gtfsrt/alerts.aspx
    • Trip Updates:
      http://api.bart.gov/gtfsrt/tripupdate.aspx
  • YRT/Viva (link)

    • Service Alerts:
      http://rtu.york.ca/gtfsrealtime/ServiceAlerts
    • Trip Updates:
      http://rtu.york.ca/gtfsrealtime/TripUpdates
    • Vehicle Positions:
      http://rtu.york.ca/gtfsrealtime/VehiclePositions

Feeds Not Yet Confirmed:

Feeds Not Working:

Compiling

$ virtualenv .venv (optional)
$ pip install -r requirements.txt
$ ./pyinstaller.sh (See dist/gtfs_realtime_json)

gtfs_realtime_json's People

Contributors

harrytruong avatar fabmazz avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.