A command-line tool for planning public transport routes across Slovakia using open GTFS data. This tool can find optimal routes, including transfers, by combining different modes of transport like trains and city public transit.
- Data Scraper: Automatically downloads the latest GTFS feeds for Slovak Railways (ZSSK) and Bratislava's public transport (IDS BK).
- Database Creation: Processes and loads the GTFS data into a local SQLite database for efficient querying.
- Advanced Route Planning: Uses a Dijkstra-based algorithm to find the best route between two destinations, considering transfers.
- Python 3.x
- Pip
-
Clone the repository:
git clone https://github.com/havrancek/SK_travel_planner.git cd SK_travel_planner
-
Install the required Python libraries:
pip install -r requirements.txt
-
Download and prepare the GTFS data: This step downloads several hundred megabytes of data and prepares the database. It may take a few minutes.
python3 scraper.py # The import_gtfs_to_db.py script is now integrated into the planner.
To find a route, run the planner.py
script with the following arguments:
--from
: The starting stop (e.g., "Bratislava").--to
: The destination stop (e.g., "Nitra").--time
: The departure time in HH:MM:SS format.
Example:
python3 planner.py --from "Bratislava" --to "Nitra" --time "08:00:00"