Skip to content
This repository has been archived by the owner. It is now read-only.
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


HRT will begin supporting real time data and has stopped sharing their hack-y real-time feed. This project is no longer useful.


HRT Bus API publishes real time bus data from Hampton Roads Transit through an application programming interface for developers to make apps from it.

HRT Bus API consists of Python scripts and a Flask app that transform, store, and expose HRT Bus data through a RESTful API. API's don't make for good demos, so we've created an HRT Bus Finder App.

Try It


HRT exposes the real time location of their buses through a text file exposed through an FTP server. Unfortunately, this file gives us less than five minutes of data and most of the entries don't have a route number associated with them. Riders lookup bus information by route number, so without it, the data isn't very useful.


Transform and Store Data - Python Scripts

  • Process GTFS - Fetches the HRT GTFS package and stores the scheduled stop times for a single day in MongoDB.
  • Process FTP - Fetches the HRT FTP file and stores the data in MongoDB. Also attempts to set route number when it's missing.

Expose Data - Python Flask

Setup for Local Development

  1. Install Python 2

  2. Install virtualenv

  3. Clone this repo

  4. Create a virtual environment in the top level directory of the repo

    $ virtualenv venv --distribute
  5. Activate the environment

    $ source venv/bin/activate

    -OR- for Windows

    $ venv\Scripts\activate.bat
  6. Install dependencies

    $ pip install -r requirements.txt


If you would like to develop the scripts, you will need your own MongoDB instance. I recommend mLab. If you just want to work on the web app, feel free to skip the part about the scripts. Ask someone on the team for read-only access to our production MongoDB instance.

Web App

  1. Set MongoDB URI (substitue your own MongoDB instance if you have one)

    $ export MONGO_URI=mongodb://<MONGODB_URI>

    -OR- for Windows

    $ set MONGO_URI=mongodb://<MONGODB_URI>
  2. Change to the web directory and run the flask app

    $ cd web
    $ python 
  3. Browse to


We deploy to Heroku. Check this wiki page

We're Here to Help


API and Map app that transform, store, and expose HRT Bus data through a RESTful HTTP endpoint. Python, Heroku, @bschoenfeld




No releases published
You can’t perform that action at this time.