{"id":13573263,"url":"https://github.com/Code4HR/hrt-bus-api","last_synced_at":"2025-04-04T12:30:33.142Z","repository":{"id":5245720,"uuid":"6423280","full_name":"Code4HR/hrt-bus-api","owner":"Code4HR","description":"API and Map app that transform, store, and expose HRT Bus data through a RESTful HTTP endpoint. Python, Heroku, @bschoenfeld","archived":true,"fork":false,"pushed_at":"2020-07-15T20:19:30.000Z","size":1267,"stargazers_count":17,"open_issues_count":13,"forks_count":13,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-05T07:36:14.050Z","etag":null,"topics":["hrtbus","official"],"latest_commit_sha":null,"homepage":"api.hrtb.us/api","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"obfusk/autossh-init","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Code4HR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-28T01:15:28.000Z","updated_at":"2024-06-25T17:12:14.000Z","dependencies_parsed_at":"2022-09-07T06:20:06.552Z","dependency_job_id":null,"html_url":"https://github.com/Code4HR/hrt-bus-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code4HR%2Fhrt-bus-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code4HR%2Fhrt-bus-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code4HR%2Fhrt-bus-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code4HR%2Fhrt-bus-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Code4HR","download_url":"https://codeload.github.com/Code4HR/hrt-bus-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247179333,"owners_count":20897017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hrtbus","official"],"created_at":"2024-08-01T15:00:32.462Z","updated_at":"2025-04-04T12:30:31.569Z","avatar_url":"https://github.com/Code4HR.png","language":"JavaScript","readme":"# ARCHIVED\nHRT will begin supporting real time data and has stopped sharing their hack-y real-time feed. This project is no longer useful.\n\n# hrt-bus-api\nHRT Bus API publishes real time bus data from Hampton Roads Transit through an application programming interface for developers to make apps from it.\n\nHRT 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.\n\n## Try It\n* Web App: [hrtb.us](http://hrtb.us)\n* REST Api: [api.hrtb.us/api](http://api.hrtb.us/api/)\n\n## Problem\nHRT 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.\n\n## Solution\n\n### Transform and Store Data - Python Scripts\n* [Process GTFS](https://github.com/code4hr/hrt-bus-api/tree/master/scripts/gtfs.py) - Fetches the HRT GTFS package and stores the scheduled stop times for a single day in MongoDB.\n* [Process FTP](https://github.com/code4hr/hrt-bus-api/tree/master/scripts/ftp.py) - Fetches the HRT FTP file and stores the data in MongoDB. Also attempts to set route number when it's missing.\n\n### Expose Data - Python Flask\n* Web App\n    * [RESTful API](https://github.com/code4hr/hrt-bus-api/wiki/RESTful-API)\n\n## Setup for Local Development\n\n1. Install [Python 2](http://wiki.python.org/moin/BeginnersGuide/Download)\n2. Install [virtualenv](https://pypi.python.org/pypi/virtualenv)\n3. Clone this repo\n4. Create a virtual environment in the top level directory of the repo\n\n    ```\n    $ virtualenv venv --distribute\n    ```\n    \n5. Activate the environment\n\n    ```\n    $ source venv/bin/activate\n    ```\n    -OR-  for Windows\n    ```\n    $ venv\\Scripts\\activate.bat\n    ```    \n    \n6. Install dependencies\n\n    ```\n    $ pip install -r requirements.txt\n    ```\n\n### Scripts\nIf you would like to develop the scripts, you will need your own MongoDB instance. I recommend [mLab](https://mLab.com/). 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.\n\n### Web App\n\n1. Set MongoDB URI (substitue your own MongoDB instance if you have one)\n\n    ```\n    $ export MONGO_URI=mongodb://\u003cMONGODB_URI\u003e\n    ```\n    -OR-  for Windows\n    ```\n    $ set MONGO_URI=mongodb://\u003cMONGODB_URI\u003e\n    ```\n2. Change to the web directory and run the flask app\n\n    ```\n    $ cd web\n    $ python app.py \n    ```\n    \n3. Browse to `http://0.0.0.0:5000/`\n\n## Deployment\n\nWe deploy to [Heroku](http://www.heroku.com/). Check this [wiki page](https://github.com/c4hrva/hrt-bus-api/wiki/Deploying-To-Heroku)\n\n## We're Here to Help\n* Ben - [@OilyTheOtter](http://twitter.com/oilytheotter)\n* Blaine - [@wbprice](https://twitter.com/wbprice)\n* Stanley - [@StanZheng](https://twitter.com/StanZheng)\n","funding_links":[],"categories":["Uncategorized","Using Data"],"sub_categories":["Uncategorized","Consumer Apps"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCode4HR%2Fhrt-bus-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCode4HR%2Fhrt-bus-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCode4HR%2Fhrt-bus-api/lists"}