All Projects → Code4HR → hrt-bus-api

Code4HR / hrt-bus-api

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

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to hrt-bus-api

TRAR-VQA
[ICCV 2021] TRAR: Routing the Attention Spans in Transformers for Visual Question Answering -- Official Implementation
Stars: ✭ 49 (+172.22%)
Mutual labels:  official
StyleSpeech
Official implementation of Meta-StyleSpeech and StyleSpeech
Stars: ✭ 161 (+794.44%)
Mutual labels:  official
open-health-inspection-app
The frontend for Code for Hampton Roads' Open Health Inspection Data.
Stars: ✭ 13 (-27.78%)
Mutual labels:  official
deepl-python
Official Python library for the DeepL language translation API.
Stars: ✭ 548 (+2944.44%)
Mutual labels:  official
gulp-html
Gulp plugin for HTML validation, using the official Nu Html Checker (v.Nu)
Stars: ✭ 70 (+288.89%)
Mutual labels:  official
okcandidate-v1
A platform for matching candidates with voters.
Stars: ✭ 16 (-11.11%)
Mutual labels:  official
Sickrage
Mirror of OFFICIAL SiCKRAGE
Stars: ✭ 1,526 (+8377.78%)
Mutual labels:  official
Singan
Official pytorch implementation of the paper: "SinGAN: Learning a Generative Model from a Single Natural Image"
Stars: ✭ 2,983 (+16472.22%)
Mutual labels:  official
cocainediesel
OFFICIAL COCAINE DIESEL REPOSITORY
Stars: ✭ 44 (+144.44%)
Mutual labels:  official
flame
Original Pytorch Implementation of FLAME: Facial Landmark Heatmap Activated Multimodal Gaze Estimation
Stars: ✭ 13 (-27.78%)
Mutual labels:  official
gdscjgec.github.io
Official Website for GDSC JGEC
Stars: ✭ 16 (-11.11%)
Mutual labels:  official
thrust-platform
1980s physics blaster "Thrust" inspired game platform
Stars: ✭ 15 (-16.67%)
Mutual labels:  official
emerald-web3-gateway
The Web3 Gateway for the Oasis Emerald ParaTime.
Stars: ✭ 19 (+5.56%)
Mutual labels:  official
SimilarWebApi
Official SimilarWeb API PHP Client
Stars: ✭ 18 (+0%)
Mutual labels:  official
A-Hierarchical-Transformation-Discriminating-Generative-Model-for-Few-Shot-Anomaly-Detection
Official pytorch implementation of the paper: "A Hierarchical Transformation-Discriminating Generative Model for Few Shot Anomaly Detection"
Stars: ✭ 42 (+133.33%)
Mutual labels:  official

ARCHIVED

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

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

Problem

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.

Solution

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
    

Scripts

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 app.py 
    
  3. Browse to http://0.0.0.0:5000/

Deployment

We deploy to Heroku. Check this wiki page

We're Here to Help

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].