CLI tool to obtain schedule info from the dutch railway services
Project description
Installation
To install, run the following:
pip install nstimes
To verify, run:
nstimes --version
To install auto-completion, run:
nstimes --install-completion
In order for autocomplete to work, one might need to add this to their .zshrc:
echo -e "\ncompinit -D\n" | tee -a ~/.zshrc
source ~/.zshrc # Reload shell
Obtaining NS token Create an account at the NS API portal. Then create a token here.
Add the token to your shell:
echo -e "\nexport NS_API_TOKEN=****\n" | tee -a ~/.zshrc
source ~/.zshrc # Reload shell
nstimes
Find your next train home while you are in CLI. I used the Dutch Railway Services (Nederlandse Spoorwegen) API to make myself this tool.
Usage:
$ nstimes [OPTIONS] COMMAND [ARGS]...
Options:
--version: Print version info--install-completion: Install completion for the current shell.--show-completion: Show completion for the current shell, to copy it or customize the installation.--help: Show this message and exit.
Commands:
journey: Provide train type, platform and departure...update-stations-json
nstimes journey
Provide train type, platform and departure times of an A -> B journey
Usage:
$ nstimes journey [OPTIONS]
Options:
--start TEXT: Start station [required]--end TEXT: Stop station [required]--token TEXT: Token to talk with the NS API [env var: NS_API_TOKEN; required]--time TEXT: Time to departure (%H:%M) [default: 13:30]--date TEXT: Date to departure (%d-%m-%Y) [default: 12-10-2023]--print-table: Print table instead of text--help: Show this message and exit.
nstimes update-stations-json
Usage:
$ nstimes update-stations-json [OPTIONS]
Options:
--token TEXT: Token to talk with the NS API [env var: NS_API_TOKEN; required]--help: Show this message and exit.
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
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 nstimes-0.1.10.tar.gz.
File metadata
- Download URL: nstimes-0.1.10.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/6.2.0-1012-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d07dd027d52c0e17455df5ebe6485cf7345473821ee64e64dcea84ee4352094
|
|
| MD5 |
cd91fda22fce33a44c2a8cbe329655e4
|
|
| BLAKE2b-256 |
6215c69e08e7bb3540c24d5918c028fb2360935e1654e4010705584710708696
|
File details
Details for the file nstimes-0.1.10-py3-none-any.whl.
File metadata
- Download URL: nstimes-0.1.10-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/6.2.0-1012-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2389b5964c6359a1f5e289bdce462513eb9ed00f8e27ddeba93e044f56d9b12f
|
|
| MD5 |
6671322860fb774ba3b4cad19afac174
|
|
| BLAKE2b-256 |
1bc192247dbcfb69cd4ff380fbf229aaa810ba3a640a5765d0b871768ff163ab
|