https://github.com/nikhilweee/path-api
Python API for PATH Trains
https://github.com/nikhilweee/path-api
Last synced: about 1 month ago
JSON representation
Python API for PATH Trains
- Host: GitHub
- URL: https://github.com/nikhilweee/path-api
- Owner: nikhilweee
- Created: 2024-09-06T22:27:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-06T02:34:52.000Z (5 months ago)
- Last Synced: 2025-09-24T00:46:12.089Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 72.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# path-api
A python implementation of the PATH API.
Mainly intended to be a replacement for the public API available at
https://www.panynj.gov/bin/portauthority/ridepath.json
# Setup
Install dependencies using your favourite package manager.
```console
$ uv sync
```
# Usage
(One-time setup) Fetch the latest database.
```console
$ python path/db.py
```
Listen to SignalR Hubs for new messages.
```console
$ python listen.py
```
Start a FastAPI server to serve data.
```console
$ fastapi run api.py
```
The latest data should be available at http://localhost:8000/ridepath.json.
# Docker
Spin up containers for the listener and the API server using docker compose.
```
$ docker compose up -d
```
# References
1. Matt Razza's [API](https://github.com/mrazza/path-data) written in C#
1. Matt Razza's
[blog post](https://medium.com/@mrazza/programmatic-path-real-time-arrival-data-5d0884ae1ad6)
on Medium
1. [Public API](https://www.panynj.gov/bin/portauthority/ridepath.json) on
panynj.gov