Skip to main content

A terminal UI for tracking Amtrak train status with auto-refresh

Project description

amtrak-status

PyPI Tests Changelog License

A clean terminal user interface (TUI) for tracking Amtrak train status in real-time. No more manual page refreshing!

Features

  • Auto-refresh: Automatically updates every 30 seconds (configurable)
  • Visual progress bar: See journey completion at a glance
  • Station-by-station breakdown: Scheduled, estimated, and actual times
  • Color-coded status: Green for early/on-time, red for late, yellow for en-route
  • Clean TUI: Built with Rich for a beautiful terminal experience

Installation

Using uv (recommended)

# Run directly without installing
uv run --with amtrak-status amtrak-status 42

# Or install as a project
uv sync
uv run amtrak-status 42

Using pip

pip install amtrak-status
amtrak-status 42

Usage

# Track the Pennsylvanian #42
amtrak-status 42

# Track the California Zephyr #5
amtrak-status 5

# Track with custom refresh interval (60 seconds)
amtrak-status 42 -r 60

# Display once and exit (no auto-refresh)
amtrak-status 42 --once

# Track a specific day's train (train 42 from the 26th)
amtrak-status 42-26

Options

Option Description
train_number Amtrak train number (e.g., 42, 5, 91)
-r, --refresh Refresh interval in seconds (default: 30)
--once Display once and exit without auto-refresh

Common Train Numbers

Number Route
42 Pennsylvanian (Pittsburgh → NYC)
43 Pennsylvanian (NYC → Pittsburgh)
5 California Zephyr (Chicago → Emeryville)
6 California Zephyr (Emeryville → Chicago)
91 Silver Star (NYC → Miami)
92 Silver Star (Miami → NYC)
79/80 Carolinian
19/20 Crescent

How It Works

This tool uses the Amtraker API, a community-built API that provides real-time Amtrak train tracking data. The API pulls from Amtrak's official Track Your Train system.

Troubleshooting

"Train Not Found"

  • The train may not have started its journey yet today
  • Double-check the train number on Amtrak's website
  • The train may have already completed its journey

No updates showing

  • The Amtraker API updates when Amtrak's system updates (typically every few minutes)
  • Check your internet connection

Development

To contribute to this library, first checkout the code. Then create a new virtual environment:

cd amtrak-status
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

python -m pip install -e '.[test]'

To run the tests:

python -m pytest

License

Apache-2.0

Credits

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

amtrak_status-0.1.0.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amtrak_status-0.1.0-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file amtrak_status-0.1.0.tar.gz.

File metadata

  • Download URL: amtrak_status-0.1.0.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for amtrak_status-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f827de6cab66e3f2b4e1d173a5bad770219dac47c02c6b3d9006bda905f98b8c
MD5 a32a3d65d6b1d7f0ad6135b788e71929
BLAKE2b-256 2d04f87baeb6eee38fd7f44174842cca1b902a898056680afbd0890e307e0064

See more details on using hashes here.

Provenance

The following attestation bundles were made for amtrak_status-0.1.0.tar.gz:

Publisher: publish.yml on theFestest/amtrak-status

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file amtrak_status-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: amtrak_status-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for amtrak_status-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7920e917fe00aa5eec5b1dd474e11cb5cb4b75bf591c0ed5cd3c320d13eac2bc
MD5 f6b6370eeb8af3d61f6f77dca23f9782
BLAKE2b-256 4396b5ade4cde4fa539003f1c0cb6d099c3ed34c175a49fc805ab897194232aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for amtrak_status-0.1.0-py3-none-any.whl:

Publisher: publish.yml on theFestest/amtrak-status

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page