Get faster Renfe Spanish Trains timetables in your terminal.
Project description
Renfe Timetables CLI
Get faster Renfe trains timetables in your terminal, with Python3.7+ support. No longer need to open the browser! Just keep using your terminal 😀
renfe-cli
is written in Rust (since v4.0.0) and published to pypi.org as a Python package (CLI and library).
See the changelog.
NOTE since I am more often using Rodalies trains I have created rodalies-cli. I hope you like it too!
Installation
Install Python CLI package renfe-cli
pip install renfe-cli --upgrade
Usage (CLI)
This CLI behaves as a person/bot going through the official renfe.com search site, using headless chrome browser. If the headless chrome browser is not found it will be downloaded.
The navigation through the site happens in the following steps:
- Writes down and selects origin station
- Writes down and selects destination station
- Writes down and selects the day to search for
- Writes down and selects the month to search for
- Writes down and selects the year to search for
- Clicks on search button
- Parses the HTML data and prints the timetable
$ renfe-cli -h
Usage: renfe-cli [options]
Options:
-f ORIGIN Set From origin station
-t DESTINATION Set To destination station
-d, --day DAY Set Day to search timetable for
-m, --month MONTH Set Month to search timetable for
-y, --year YEAR Set Year to search timetable for
-h, --help print this help menu
Getting the timetable
In this new major release there is still no interactive mode nor defaults; one must provide all inputs, like:
$ renfe-cli -f Tarr -t Mad -d 27 -m 11 -y 2023
loading headless chrome browser
navigating to renfe timetable search page
waiting for search page
adding origin station
adding destination station
adding day
adding month
adding year
searching timetable
got timetable page
loading timetable
=========================TIMETABLE=========================
Train | Departure | Arrival | Duration
-----------------------------------------------------------
AVE | 06.25 | 09.10 | 2 h. 45 min.
-----------------------------------------------------------
LD-AVE | 08.22 | 15.35 | 7 h. 13 min.
-----------------------------------------------------------
AVE | 08.34 | 11.12 | 2 h. 38 min.
-----------------------------------------------------------
REG.EXP. | 10.11 | 18.09 | 7 h. 58 min.
-----------------------------------------------------------
AVLO | 10.34 | 13.17 | 2 h. 43 min.
-----------------------------------------------------------
LD-AVE | 10.51 | 15.35 | 4 h. 44 min.
-----------------------------------------------------------
AVE | 12.34 | 15.12 | 2 h. 38 min.
-----------------------------------------------------------
AVE INT | 13.22 | 15.45 | 2 h. 23 min.
-----------------------------------------------------------
AVE | 14.34 | 17.12 | 2 h. 38 min.
-----------------------------------------------------------
AVE | 16.34 | 19.12 | 2 h. 38 min.
-----------------------------------------------------------
AVE | 18.34 | 21.12 | 2 h. 38 min.
-----------------------------------------------------------
AVE | 19.14 | 21.45 | 2 h. 31 min.
-----------------------------------------------------------
AVE | 20.34 | 23.12 | 2 h. 38 min.
===========================================================
Usage (Library)
TBD
Contribute or Report with Issues
If Renfe's website is changed or you find any issue to be fixed or nice enhancements to have, please: create an issue.
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 Distributions
Hashes for renfe_cli-4.0.0-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3be6480a23b393c047a07b11cda10f5b910c8c0e601a2fc82878a074a925f246 |
|
MD5 | 33a743510e0538bf8a85687fff0c9b76 |
|
BLAKE2b-256 | 6953409a85385cb6b52e8ab8713f2ee00e6aa5430b0a183eff6cc075cbba839c |
Hashes for renfe_cli-4.0.0-cp37-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 551a87c6a0ce374f0c56e565e81cdfc9dc05f20f314c5665a63e2cf11d64d6b5 |
|
MD5 | 40fe375e51193646cfc9ee61575d6d8b |
|
BLAKE2b-256 | 990efb154fc885f0e9beb63c7cee1a30e7ca823261730a8b67fcabb2a7a04f39 |
Hashes for renfe_cli-4.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c41785bec9746c932a4fd900aff5672bcda6a4e921c39386f9d5be79c2ebf09 |
|
MD5 | 5eb09f897076e264842e59cfd60a80de |
|
BLAKE2b-256 | 08dda3221fb291b883b53987163d72eab13f18345a1ab2eb04be87d0e01f9ae4 |
Hashes for renfe_cli-4.0.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ed0208270882c0a182be6145f5fd84687b46e180276306e357e92c207c26c12 |
|
MD5 | d26f8006ddf1e73111e17bfbe56495c0 |
|
BLAKE2b-256 | 91e9357eeed71d6cb81d97748180a0847eb051bda195d0649d9cfc363851cd3b |
Hashes for renfe_cli-4.0.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c893bd7d26dd75509f61bb15aee1820c52dbc5d8777d710e665d8a668e4b479d |
|
MD5 | f32cfb4a9737127d0c93fb50f2f360a4 |
|
BLAKE2b-256 | abab1610f4a82ee14dc1392cfe3fca49fc2048f56eb3273a0ee71d56b6a6b443 |
Hashes for renfe_cli-4.0.0-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa2fe39d5a882f8df3a46a341894c9030b1cf06844d20b5db2a8dfa0fe125ab9 |
|
MD5 | 6887192d65a82267d237557521909231 |
|
BLAKE2b-256 | 78f66265cb9819d4b9e1a02cf37af5640e817716954cfb93eb5e92ad17053f93 |
Hashes for renfe_cli-4.0.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3123ca5bc44979f7c6cf70c58e460f931a094c55150887f2d78ce401f20bef5f |
|
MD5 | 14912bfaaa251b9bf53114b0001f99a3 |
|
BLAKE2b-256 | b68ea2aa4f01429efe5720613fda9a7395b865066f8fa23a18b234d84e4dcb79 |
Hashes for renfe_cli-4.0.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15fe88a8235f3d6eb00b7e5fa53c79f6c0bb97095c7e1b633cf35d3fdb543bfb |
|
MD5 | 19412486d73796ba906326531000d5c1 |
|
BLAKE2b-256 | 6f5da4d61d02f3d676d1eb9a9b495fc20ddc05d86f523bc14c81c6d395e8df13 |
Hashes for renfe_cli-4.0.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a548ccc431a1168b4ff90f4bf672a6a833f1d01650b8441c0503f2c2883c2c75 |
|
MD5 | 2e8a3e52c981564188f41307bcf0b99d |
|
BLAKE2b-256 | d5dbf8b814eb8139f12d3ff862ea806bffe718b751c988ffeee4d954b4ae6c44 |