Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-11T02:05:48.000Z (4 months ago)
- Last Synced: 2024-09-11T07:12:31.428Z (4 months ago)
- Language: Python
- Homepage:
- Size: 40 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