https://github.com/maxmouchet/locomotive
Python API clients for France's railways.
https://github.com/maxmouchet/locomotive
api cli france python sncf ter tgv train
Last synced: 6 months ago
JSON representation
Python API clients for France's railways.
- Host: GitHub
- URL: https://github.com/maxmouchet/locomotive
- Owner: maxmouchet
- License: mit
- Created: 2019-06-03T15:56:42.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-11-15T18:01:15.000Z (over 2 years ago)
- Last Synced: 2024-12-01T12:47:19.762Z (7 months ago)
- Topics: api, cli, france, python, sncf, ter, tgv, train
- Language: Python
- Homepage:
- Size: 4.73 MB
- Stars: 45
- Watchers: 5
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Python API clients and a CLI for France's railways :sparkles:
![]()
![]()
![]()
![]()
![]()
## Installation
`locomotive` requires Python 3.6+ and can be installed using [pip](https://pip.pypa.io/en/stable/):
```bash
pip install locomotive
```## API Clients
Module | Features | Status
-------|----------|-------
[oui_v3](/locomotive/api/oui_v3.py) | Travel Request | 
[gc](/locomotive/api/gc.py) | Board Request | ## CLI
locomotive is easy to use. Find below simple examples:
```bash
locomotive search --help
# Search by city name
locomotive search Amsterdam Paris
# Search by train station code (Amsterdam to Paris here)
locomotive search NLAMA FRPAR
# Specify the date and the travel class
locomotive search Brest Paris --date 2019/07/14 --class first
```## Development
```bash
poetry install
poetry run locomotive# pre-commit
poetry run pre-commit install
poetry run pre-commit run --all-files
```### Releases
```bash
poetry version X.Y.Z # e.g. v0.4.0
git tag vX.Y.Z
git push --tags
```## Licenses
locomotive is released under the [MIT license](https://github.com/maxmouchet/locomotive/blob/master/LICENSE).
The train stations database (`stations-lite.csv`) is derived from `stations.csv` ([trainline-eu/stations](https://github.com/trainline-eu/stations)) released under the Open Database License (ODbL) license.*Logo: Train Tickets by b farias from the Noun Project.*