{"id":48088120,"url":"https://github.com/tnoff/public-transit","last_synced_at":"2026-04-04T15:25:49.174Z","repository":{"id":69235308,"uuid":"30855835","full_name":"tnoff/public-transit","owner":"tnoff","description":"Pip installable API for public transit systems","archived":false,"fork":false,"pushed_at":"2026-03-29T06:07:47.000Z","size":573,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T08:25:40.026Z","etag":null,"topics":["actransit","bart","nextbus","public-transit","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tnoff.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.rst","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2015-02-16T05:55:32.000Z","updated_at":"2026-03-29T06:07:49.000Z","dependencies_parsed_at":"2025-12-16T04:04:25.536Z","dependency_job_id":null,"html_url":"https://github.com/tnoff/public-transit","commit_stats":null,"previous_names":["tylernorth/public-transit"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/tnoff/public-transit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnoff%2Fpublic-transit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnoff%2Fpublic-transit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnoff%2Fpublic-transit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnoff%2Fpublic-transit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tnoff","download_url":"https://codeload.github.com/tnoff/public-transit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnoff%2Fpublic-transit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31403958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: 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":["actransit","bart","nextbus","public-transit","python"],"created_at":"2026-04-04T15:25:49.090Z","updated_at":"2026-04-04T15:25:49.162Z","avatar_url":"https://github.com/tnoff.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Public Transit API\n\nPython library and CLI tools for three Bay Area transit APIs:\n\n- [BART API](http://api.bart.gov/docs/overview/index.aspx)\n- [AC Transit API](https://www.actransit.org/data-api-resource-center)\n- [NextBus XML Feed](http://www.nextbus.com/xmlFeedDocs/NextBusXMLFeed.pdf)\n\n## Install\n\n```bash\ngit clone https://github.com/tnoff/public-transit.git\npip install public-transit/\n```\n\n## Docker\n\nIf you'd rather not set up a local Python environment, you can build and run with Docker:\n\n```bash\ngit clone https://github.com/tnoff/public-transit.git\ncd public-transit\ndocker build -t public-transit .\n```\n\nThen run any of the CLI commands:\n\n```bash\ndocker run --rm public-transit bart --help\ndocker run --rm public-transit actransit --help\ndocker run --rm public-transit nextbus agency-list\n```\n\nFor `trip-planner`, mount a local directory so the SQLite database persists between runs:\n\n```bash\ndocker run --rm -v \"$HOME/.trip_planner:/root/.trip_planner\" public-transit trip-planner leg-list\n```\n\n## CLI Scripts\n\nInstalling the package provides four commands:\n\n| Command | Description |\n|---|---|\n| `bart` | BART station departures, advisories, and train info |\n| `actransit` | AC Transit routes, trips, and stop predictions |\n| `nextbus` | NextBus agency, route, and stop predictions |\n| `trip-planner` | Save and query common routes across all agencies |\n\nRun any command with `--help` for full usage details, e.g. `bart --help`.\n\n## Python API\n\nEach transit module exposes standalone functions. Import from the relevant client module:\n\n```python\nfrom transit.modules.bart import client as bart\n\n# Requires a BART API key (public demo key: MW9S-E7SL-26DU-VV8V)\ndepartures = bart.station_departures('MW9S-E7SL-26DU-VV8V', 'MONT')\nstations = bart.station_list('MW9S-E7SL-26DU-VV8V')\n```\n\n```python\nfrom transit.modules.actransit import client as actransit\n\n# Requires an AC Transit API key\npredictions = actransit.stop_predictions(api_key, '51303')\n```\n\n```python\nfrom transit.modules.nextbus import client as nextbus\n\n# No API key required\nagencies = nextbus.agency_list()\npredictions = nextbus.stop_prediction('sf-muni', '15684')\n```\n\n## Trip Planner\n\nTrip planner lets you save frequently used stops and destinations to a local SQLite database, then query them all at once.\n\nA **leg** is a stop at a specific agency, optionally filtered to certain destinations. A **trip** is an ordered collection of legs.\n\n```bash\n# Create a leg: BART Montgomery St., filtering to Fremont-bound trains\n$ trip-planner leg-create bart mont --destinations frmt\n{\n    \"stop_id\": \"mont\",\n    \"stop_title\": \"Montgomery St.\",\n    \"agency\": \"bart\",\n    \"stop_tag\": null,\n    \"includes\": [\n        \"frmt\"\n    ]\n}\n\n# Show live departure times for all legs in a saved trip\n$ trip-planner trip-show 2\nAgency bart\nStop                     | Destination              | Times (Seconds)\n--------------------------------------------------------------------------------\nConcord                  | SF Airport               | 2640\n================================================================================\n```\n\nThe `destinations` filter corresponds to:\n- The terminal station abbreviation for BART routes (e.g. `DUBL`, `FRMT`)\n- The route tag for NextBus stops (e.g. `38` for the 38-Geary on sf-muni)\n\nRun `trip-planner --help` for the full list of commands.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnoff%2Fpublic-transit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftnoff%2Fpublic-transit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnoff%2Fpublic-transit/lists"}