从cli搜索sncf行程。
sncf-cli的Python项目详细描述
:列车2:sncf cli
你喜欢SNCF。你喜欢命令行工具。sncf cli是为您量身定做的!
一个手工制作的api客户端和法国国家铁路的命令行界面:sparkes:
Installation• Usage• Development
安装
sncf-cli
需要python 3.6+并且可以使用pip:
pip install sncf-cli
用法
sncf cli易于使用。下面是一些简单的例子:
# 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
清单:
- []自述文件中的屏幕截图是最新的。
设计说明和未来计划
目前,Formatter
与api响应格式紧密耦合。将来,我们可能会在不同的api版本上实现一个抽象。
我们使用attrs
而不是@dataclass
来实现python 3.6的兼容性。
许可证
sncf cli在MIT license下发布。
火车站数据库(stations-lite.csv
)源于开放数据库许可证(odbl)下发布的stations.csv
(trainline-eu/stations)。