A Python package to get data from the Septa API
Project description
━━━━━━ ❖ ━━━━━━
❖ TheSeptaTimes
TheSeptaTimes is a python package designed to make accessing info about Septa's regional rail network easier. I made this because I commute to college every day via septa, and checking the time for the next train via the app or the website simply takes too much time. I wanted something I could access from my terminal, and thus, TheSeptaTimes was born.
❖ Installation
Install from pip
pip3 install TheSeptaTimes
Install from source
- First, install poetry
git clone https://github.com/ZenithDS/TheSeptaTimes.git
cd TheSeptaTimes
poetry build
pip3 install ./dist/theseptatimes-0.1.1.tar.gz
❖ Usage
As CLI App
Usage: tst [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
arrivals Find the next arrivals at a given train station
next Search for the next train going from an origin to a destination
search Search for a given station
train Track a given train using it's number
Fuzzy search for a train station
tst search admr
Get times for the next two trains that go from a given train station to another
tst next '30th Street Station' 'North Philadelphia'
List the next 6 arrivals at a given train station
tst arrivals '30th Street Station' 6
Take a look at any given train's schedule using the train number
tst train 9374
As Python Library/Package
print the next train going from a given train station to another
from TheSeptaTimes import TheSeptaTimes
septa = TheSeptaTimes()
next_trains = septa.get_next_to_arrive('30th Street Station', 'North Philadelphia', 1)
readable_next_trains = septa.parse_next_to_arrive(next_trains)
for train in readable_next_trains:
print(train)
print the next 6 arrivals at a given train station
from TheSeptaTimes import TheSeptaTimes
septa = TheSeptaTimes()
trains = septa.get_station_arrivals('30th Street Station', 5)
readable_trains = septa.parse_station_arrivals(trains)
for train in readable_trains:
print(train)
print any given train's schedule using the train number
from TheSeptaTimes import TheSeptaTimes
septa = TheSeptaTimes()
train_schedule = septa.get_train_schedule(9374)
readable_train_schedule = septa.parse_train_schedule(train_schedule)
for stop in readable_train_schedule:
print(stop)
❖ What's New?
0.1.1 - Fixed imports and added type hints
Project details
Release history Release notifications | RSS feed
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
Hashes for theseptatimes-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 839ccdd1842575892e5d5f85e0e1500075f9fdf1b8a82cc82488986403917447 |
|
MD5 | 88c0fe5fb2b3548a524bc8eea2633ab6 |
|
BLAKE2b-256 | ffc01532b54c387ae654518e4331c865291305478bbdd02f7057e2a9febb94ea |