https://github.com/alifeee/train-tracking
Tracking live trains
https://github.com/alifeee/train-tracking
opentraintimes python train-tracking
Last synced: about 1 year ago
JSON representation
Tracking live trains
- Host: GitHub
- URL: https://github.com/alifeee/train-tracking
- Owner: alifeee
- Created: 2024-03-12T13:39:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-12T14:04:31.000Z (over 2 years ago)
- Last Synced: 2025-03-28T16:49:57.200Z (over 1 year ago)
- Topics: opentraintimes, python, train-tracking
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Train tracking
Using to get train headcodes.
Using to get trains from those headcodes.
## Requirements
- Python 3
## Setup
```bash
python -m venv env
pip install -r requirements.txt
```
## Run
### Find train
`not implemented`
### Find headcode
```bash
> python headcode.py
Found 4 results
Result 1: https://live.rail-record.co.uk/train/?c=W33810&d=2024-03-12
Departure time: d. 1148
From: Manchester Piccadilly
To: Sheffield
Operator: Northern
2S80 d. 1148Manchester Piccadilly Sheffield https://live.rail-record.co.uk/train/?c=W33810&d=2024-03-12
...
```
...or...
```python
from headcode import Train, get_trains
HEADCODE = "5Z39"
trains = get_trains(headcode)
for train in trains:
train.pprint()
```