Giter Club home page Giter Club logo

mta_gtfs's Introduction

mtaGTFS Object Introduction and Description

The object defined in mtaGTFS allows the user to easily pull and analyze data from the NYC MTA site. This currently includes the 1, 2, 3, 4, 5, 6, S and SIR lines.

MTA Feed Description

It helps parse the GTFS file provided by the MTA. In order to obtain the data, you must first register for an api key. More information on the feeds can be found here on the mta website.

Dependencies

To use the object you must include mtaGTFS.py along with protobuf_json.py and nyct_subway_pb2.py`. This object also depends on functionality provided by the following packages:

Sqlalchemy is required for some specific functions, but not necessary for the object to function properly

Quick Start Guide

See mtaGTFS.py for details. Import mtaGTFS.py and create a a new object with: new_object = mtaGTFS(subway_group = "irt", api_key='*************') subway_group can be either 'irt', 'l', or 'sir' for each train type. Once the object is loaded the enrouteTrains, scheduledStops, and trainIds can be accessed as properties of new_object. The feeds can be updated with the updateFeed method.

Database Setup

  1. Install mysql
  2. create a user
  3. run the mysql/model_generation_script.sql
  4. Grant the mta_user all privilages: GRANT ALL PRIVILEGES ON mta_trains.* to 'mta_user'@'%' identified by 'userpassword';
  5. Open up your mysql database to remote connections This probably involves updating the bind_address
  6. Write the stops.txt file to the stops TABLE

venv Setup

python3 -m venv env
source env/bin/activate
pip install -r requirements.txt

Update protobuf files

Run the following command in the working directory

bash protobuf/compile_protobuf.sh

This will download the needed files and compile them for use in python.

mta_gtfs's People

Contributors

vitallish 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.