Search SNCF journeys from the CLI.
You love SNCF. You love command line tools. sncf-cli is made for you !
An handcrafted API client and command line interface for France's national railways :sparkles:
sncf-cli requires Python 3.6+ and can be installed using pip:
pip install sncf-cli
sncf-cli is easy to use. Find below simple examples:
# RTFM bro (just kidding) sncf-cli search --help # Search by city name sncf-cli search Amsterdam Paris # Search by train station code (Amsterdam to Paris here) sncf-cli search NLAMA FRPAR # Pick a date and even a travel class B-) sncf-cli search Brest Paris --date 2019/07/14 --class first
pip install -e .[dev] # Code formatter black locomotive/ stubs/ tests/ # Linter pylint --rcfile=setup.cfg locomotive/ # Type checker env MYPYPATH=stubs/ mypy locomotive/ # Unit tests pytest
assets/ # Images used in the README locomotive/ # Python module (see locomotive/README.md) tests/ # Unit tests
git tag vX.Y.Z # e.g. v0.4.0 git push --tags
- [ ] Screenshot in README is up to date.
Design notes & future plans
Formatters are tightly coupled with the API response format. In the future we may implement an abstraction over different APIs versions.
attrs instead of
@dataclass for Python 3.6 compatibility.
sncf-cli is released under the MIT license.
The train stations database (
stations-lite.csv) is derived from
stations.csv (trainline-eu/stations) released under the Open Database License (ODbL) license.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size sncf_cli-0.6-py3-none-any.whl (655.3 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size sncf-cli-0.6.tar.gz (823.4 kB)||File type Source||Python version None||Upload date||Hashes View hashes|