{"id":37070024,"url":"https://github.com/johnsliao/pymbta","last_synced_at":"2026-01-14T08:03:54.572Z","repository":{"id":92789209,"uuid":"50153524","full_name":"johnsliao/pymbta","owner":"johnsliao","description":"A Python wrapper around the MBTA api","archived":false,"fork":false,"pushed_at":"2016-01-28T04:21:16.000Z","size":36,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-25T01:23:00.212Z","etag":null,"topics":["bus","mbta","mbta-api","python"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/pymbta","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnsliao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-22T02:59:47.000Z","updated_at":"2022-12-19T16:10:47.000Z","dependencies_parsed_at":"2023-04-22T08:31:13.668Z","dependency_job_id":null,"html_url":"https://github.com/johnsliao/pymbta","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":0.5294117647058824,"last_synced_commit":"a95bec9835bb72fd38373e7e555f03a1893239e3"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/johnsliao/pymbta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsliao%2Fpymbta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsliao%2Fpymbta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsliao%2Fpymbta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsliao%2Fpymbta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnsliao","download_url":"https://codeload.github.com/johnsliao/pymbta/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnsliao%2Fpymbta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bus","mbta","mbta-api","python"],"created_at":"2026-01-14T08:03:54.095Z","updated_at":"2026-01-14T08:03:54.554Z","avatar_url":"https://github.com/johnsliao.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pymbta\npymbta is an intuitive pure python module to use the MBTA api to find bus and train locations.\n\nIf you encounter a bug, file an issue or email me: `john@johnliao.org`\n\n### Installation\n`$ pip install pymbta`\n\n## Set your environment variable for MBTA API Key\n1. Register a developer account with the MBTA [Dev Portal Link](http://realtime.mbta.com/Portal/Account/Register)\n2. Set your env var: `MBTA_API_KEY = my_mbta_api_key`\n\n## Usage\n\n#### Purple Line\n```\nfrom pymbta import PurpleLine\np = PurpleLine(query_type='vehiclesbyroute', direction='outbound', route='Lowell')\np.return_locations()\n```\n\n`[[u'42.3678817749023', u'-71.0630187988281']]`\n\n#### Red Line\n```\nfrom pymbta import RedLine\nr = RedLine(query_type='vehiclesbyroute', direction='northbound', route='Red Line')\nr.return_locations()\n```\n`[[u'42.37407', u'-71.11876'], [u'42.36554', u'-71.10401'], [u'42.36953', u'-71.11154'], [u'42.34832', u'-71.05348'], [u'42.36147', u'-71.07437'], [u'42.28579', u'-71.03854'], [u'42.33107', u'-71.057'], [u'42.20882', u'-71.00141']]`\n\n#### Bus\n```\nfrom pymbta import Bus\nb = Bus(query_type='vehiclesbyroute', direction='outbound', route='1')\nb.return_locations()\n```\n\n`[[u'42.3579063415527', u'-71.0928802490234'], [u'42.3404960632324', u'-71.0815887451172']]`\n\n### Routes List\nUse route_short_name as `route` parameter from [routes.txt](extra/routes.txt). Input is case sensitive (sorry)\n\n## Additional Info\nMBTA GTFS files available [here](http://www.mbta.com/uploadedfiles/MBTA_GTFS.zip)\n    \nRead more about using the MBTA-realtime API v2 [here](http://www.mbta.com/rider_tools/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnsliao%2Fpymbta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnsliao%2Fpymbta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnsliao%2Fpymbta/lists"}