Skip to content
No description, website, or topics provided.
Python TypeScript Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
data/nyc
transit-time
.flake8
.gitignore Move scraper to App Engine Feb 10, 2020
LICENSE
README.md Update README.md Feb 7, 2020

README.md

transit-time

Code for http://transit.andrewchien.com/timelapse/

Deployment

All data lives in a Postgres database. To run:

  • scraper/scraper_job.py downloads all MTA data feeds. Runs every minute (can be more/less frequent; MTA refreshes feed every 30 seconds).
  • scraper/batch_process.py takes the downloaded data and determines where trains are. Repeated runs with --job-name will pick up from where the last run left off. Runs every minute. Can be used to backfill data as well.
  • scraper/importer.py data/nyc to store static GTFS data into the database
  • scraper/import_shapes.py data/nyc/shapes.txt data/nyc/stops.txt generates the subway map given all routes and stations
  • uvicorn web.app:app to start the web server

To run the code, environment variables need to be set.

  • POSTGRES_HOST
  • POSTGRES_USER
  • POSTGRES_PASSWORD
  • NYC_MTA_API_KEY is only required for scraper.py
You can’t perform that action at this time.