https://github.com/kevcui/bahn-cli
:train: DB train timetable in CLI
https://github.com/kevcui/bahn-cli
bash bash-script cli deutsche-bahn
Last synced: about 2 months ago
JSON representation
:train: DB train timetable in CLI
- Host: GitHub
- URL: https://github.com/kevcui/bahn-cli
- Owner: KevCui
- License: mit
- Created: 2019-06-22T19:30:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-20T19:17:45.000Z (about 5 years ago)
- Last Synced: 2025-03-26T17:40:31.654Z (7 months ago)
- Topics: bash, bash-script, cli, deutsche-bahn
- Language: Shell
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bahn-cli 
CLI tool for searching train timetable from Deutsche Bahn, aka [DB](https://www.bahn.de/p/view/index.shtml).
## Dependency
- [cURL](https://curl.haxx.se/)
- [jq](https://stedolan.github.io/jq/)
- python3: [hashlib](https://docs.python.org/3/library/hashlib.html)## How to use
```
Usage:
./bahn.sh -d -a [-t ]Options:
-d Departure station name
-a Arrival station name
-t Departure date:time, like: "20190630:1300"
If it's not specified, default current date & time
-h | --help Display this help messageExamples:
- Search next trains from `hamburg` to `berlin`:
~$ ./bahn.sh -d 'hamburg hbf' -a 'berlin hbf'- Search trains from `hamburg` to `berlin` at `13:30` on `20190730`:
~$ ./bahn.sh -d 'hamburg hbf' -a 'berlin hbf' -t '20190730:1330'
```## Run tests
```
~$ bats test/bahn.bats
```## Acknowledgment
Inspired by [pajowu/db-python](https://github.com/pajowu/db-python/blob/master/bahn.py)