UK train times from your terminal
Project description
choo
UK train times from your terminal.
Install
uvx choo
Or install permanently:
pip install choo
Quick start
# 1. Get API credentials
choo auth
# 2. Set up your commute
choo config alias.home HIB
choo config alias.work LBG
# 3. Go
choo # next trains home → work
choo choo # reverse: work → home
choo KGX YRK # King's Cross to York
Commands
choo / choo next [FROM] [TO]
Show next trains between two stations. Defaults to home → work aliases.
choo # home → work, now
choo --on tomorrow # home → work, tomorrow
choo PAD BRI # Paddington to Bristol
choo next PAD BRI --at 08:30 # departing around 08:30
choo next PAD BRI --on monday # next Monday
choo next PAD BRI --count 10 # show 10 results
No trains running? Choo automatically shows tomorrow's first services.
choo choo
Reverse commute — next trains from work → home.
choo choo # heading home
choo choo --on friday # Friday evening trains
choo board [FROM] [TO]
Departure board for a station. Same arguments as next, but shows all services in a table.
choo board KGX # all departures from King's Cross
choo board KGX YRK # filtered to York
choo board KGX --arrivals # arrivals instead
choo board --on tomorrow # defaults to home station
choo service UID
Full calling pattern for a service. Get the UID from board output.
choo service C41053
choo service C41053 --on 2026-03-16
choo config
Get/set configuration, like git config.
choo config alias.home HIB # set station alias
choo config alias.work LBG
choo config next.count 10 # default number of results
choo config alias.home # get a value
choo config # list all
choo config --unset alias.home # remove
choo auth
Guided setup for RTT API credentials. Walks you through registration at api-portal.rtt.io and verifies your credentials.
choo stations update
Fetch the latest station data from GitHub (2,599 UK stations).
Flags
| Flag | Short | Description |
|---|---|---|
--at |
-t |
Time filter (HH:MM) |
--on |
-d |
Date filter (today, tomorrow, day name, or YYYY-MM-DD) |
--count |
-n |
Number of results (default: 5, configurable via next.count) |
--arrivals |
Show arrivals instead of departures | |
--json |
Output JSON for scripting | |
--verbose |
-v |
Enable debug logging |
Station resolution
Stations can be specified as:
- CRS codes:
KGX,PAD,BRI(3 uppercase letters) - Aliases:
home,work(seechoo config) - Fuzzy names:
"kings cross",paddington— matched against 2,599 stations with suggestions for ambiguous input
Configuration
Config file: ~/.config/choo/config.json (XDG via platformdirs)
| Key | Example | Description |
|---|---|---|
alias.home |
HIB |
Station alias |
alias.work |
LBG |
Station alias |
alias.* |
any CRS | Custom aliases |
next.count |
5 |
Default result count |
Environment variables (override config):
| Variable | Description |
|---|---|
CHOO_AUTH |
API credentials (user:password) |
RTT_AUTH |
API credentials (fallback) |
CHOO_ALIAS_* |
Station aliases (e.g., CHOO_ALIAS_HOME=HIB) |
traintimes SDK
Choo is built on the traintimes Python SDK, which wraps the RealTimeTrains Pull API.
from traintimes.sdk import Location, Service
# Departures from Highbury & Islington
response = Location("HIB").get()
for svc in response.services:
print(svc.service_uid, svc.location_detail.gbtt_booked_departure)
# Full calling pattern for a service
service = Service("C41053", datetime.date.today()).get()
for loc in service.locations:
print(loc.description, loc.gbtt_booked_departure)
The SDK provides Pydantic models for all API responses — see traintimes/models.py.
Credits
- Train data from the RealTimeTrains API
- Station data from davwheat/uk-railway-stations, licensed under the Open Database License (ODbL)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file choo-0.1.3.tar.gz.
File metadata
- Download URL: choo-0.1.3.tar.gz
- Upload date:
- Size: 36.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f273da3189b2833d54e6d205841ded59548ac363dac8bb396ac77feb6ca2a8d5
|
|
| MD5 |
ffe9655380ec9e09af8c138f2abe107c
|
|
| BLAKE2b-256 |
a0bcd0622fe99634638281c78b94c8fbf4e0e99ae2e18c14c46884bc3417ab4f
|
Provenance
The following attestation bundles were made for choo-0.1.3.tar.gz:
Publisher:
publish.yml on tomviner/choo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
choo-0.1.3.tar.gz -
Subject digest:
f273da3189b2833d54e6d205841ded59548ac363dac8bb396ac77feb6ca2a8d5 - Sigstore transparency entry: 1203760730
- Sigstore integration time:
-
Permalink:
tomviner/choo@be3c98bfa0012a6541ad3157d20c9f96b0a10d3d -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/tomviner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be3c98bfa0012a6541ad3157d20c9f96b0a10d3d -
Trigger Event:
release
-
Statement type:
File details
Details for the file choo-0.1.3-py3-none-any.whl.
File metadata
- Download URL: choo-0.1.3-py3-none-any.whl
- Upload date:
- Size: 39.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
017a62eb8a202ab7c2e53ba38dfc94e7665dee3ac9626a7537cb2917a602abe7
|
|
| MD5 |
3b0355f621b2c4996367b70f1de1e41a
|
|
| BLAKE2b-256 |
963743e21ff0b4edfebf7d74be57ba74cc0e3bdcdf28929df2c736db5a93fa82
|
Provenance
The following attestation bundles were made for choo-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on tomviner/choo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
choo-0.1.3-py3-none-any.whl -
Subject digest:
017a62eb8a202ab7c2e53ba38dfc94e7665dee3ac9626a7537cb2917a602abe7 - Sigstore transparency entry: 1203760737
- Sigstore integration time:
-
Permalink:
tomviner/choo@be3c98bfa0012a6541ad3157d20c9f96b0a10d3d -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/tomviner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@be3c98bfa0012a6541ad3157d20c9f96b0a10d3d -
Trigger Event:
release
-
Statement type: