{"id":24114890,"url":"https://github.com/jonthornton/mtapi","last_synced_at":"2025-04-05T20:07:00.337Z","repository":{"id":18629038,"uuid":"21835088","full_name":"jonthornton/MTAPI","owner":"jonthornton","description":"JSON proxy server for the MTA's realtime New York City subway feed","archived":false,"fork":false,"pushed_at":"2024-04-06T02:21:24.000Z","size":150,"stargazers_count":292,"open_issues_count":10,"forks_count":84,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-03-29T19:02:40.412Z","etag":null,"topics":["mta","nyc","subway","transit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonthornton.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-07-14T20:47:44.000Z","updated_at":"2025-03-02T20:16:08.000Z","dependencies_parsed_at":"2025-03-14T18:15:49.604Z","dependency_job_id":"b58b90f1-7870-4337-8001-371406f8e09c","html_url":"https://github.com/jonthornton/MTAPI","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonthornton%2FMTAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonthornton%2FMTAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonthornton%2FMTAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonthornton%2FMTAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonthornton","download_url":"https://codeload.github.com/jonthornton/MTAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393569,"owners_count":20931812,"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":["mta","nyc","subway","transit"],"created_at":"2025-01-11T05:35:53.629Z","updated_at":"2025-04-05T20:07:00.314Z","avatar_url":"https://github.com/jonthornton.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MTA Realtime API JSON Proxy\n\nMTAPI is a small HTTP server that converts the [MTA's realtime subway feed](https://api.mta.info/#/landing) from [Protocol Buffers/GTFS](https://developers.google.com/transit/gtfs/) to JSON. The app also adds caching and makes it possible to retrieve information by location and train line. \n\n## Active Development\n\nThis project is under active development and any part of the API may change. Feedback is very welcome.\n\n## Running the server\n\nMTAPI is a Flask app designed to run under Python 3.3+.\n\n1. Create a `settings.cfg` file. A sample is provided as `settings.cfg.sample`.\n2. Set up your environment and install dependencies.  \n`$ python3 -m venv .venv`  \n`$ source .venv/bin/activate`  \n`$ python3 -m pip install -r requirements.txt`\n3. Run the server  \n`$ python app.py`\n\nIf your configuration is named something other than `settings.cfg`, set the `MTAPI_SETTINGS` env variable to your configuration path.\n\nThis app makes use of Python threads. If running under uWSGI include the --enable-threads flag.\n\n## Endpoints\n\n[Endpoints to retrieve train data and sample input and output are listed here.](https://github.com/jonthornton/MTAPI/tree/master/docs/endpoints.md)\n\n## Settings\n\n- **MTA_KEY** (required)  \nThe API key provided at hhttps://api.mta.info/#/signup\n*default: None*\n\n- **STATIONS_FILE** (required)  \nPath to the JSON file containing station information. See [Generating a Stations File](#generating-a-stations-file) for more info.  \n*default: None*\n\n- **CROSS_ORIGIN**    \nAdd [CORS](http://enable-cors.org/) headers to the HTTP output.  \n*default: \"\u0026#42;\" when in debug mode, None otherwise*\n\n- **MAX_TRAINS**  \nLimits the number of trains that will be listed for each station.  \n*default: 10*\n\n- **MAX_MINUTES**  \nLimits how far in advance train information will be listed.  \n*default: 30*\n\n- **CACHE_SECONDS**  \nHow frequently the app will request fresh data from the MTA API.  \n*default: 60*\n\n- **THREADED**  \nEnable background data refresh. This will prevent requests from hanging while new data is retreived from the MTA API.  \n*default: True*\n\n- **DEBUG**  \nStandard Flask option. Will enabled enhanced logging and wildcard CORS headers.  \n*default: False*\n\n## Generating a Stations File\n\nThe MTA provides several static data files about the subway system but none include canonical information about each station. MTAPI includes a script that will parse the `stops.txt` and `transfers.txt` datasets provided by the MTA and attempt to group the different train stops into subway stations. MTAPI will use this JSON file for station names and locations. The grouping is not perfect and editing the resulting files is encouraged.\n\nUsage: \n```\n$ python make_stations_csv.py stops.txt transfers.txt \u003e stations.csv\n# edit groupings in stations.csv\n$ python make_stations_json.py stations.csv \u003e stations.json\n# edit names in stations.json\n```\n\n## Help\n\nSubmit a [GitHub Issues request](https://github.com/jonthornton/MTAPI/issues). \n\n## Projects\n\nHere are some projects that use MTAPI.\n\n* http://wheresthefuckingtrain.com\n\n## License\n\nThe project is made available under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonthornton%2Fmtapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonthornton%2Fmtapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonthornton%2Fmtapi/lists"}