Skip to content

havrancek/SK_travel_planner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SK Travel Planner

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.

Features

  • 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.

Prerequisites

  • Python 3.x
  • Pip

Setup

  1. Clone the repository:

    git clone https://github.com/havrancek/SK_travel_planner.git
    cd SK_travel_planner
  2. Install the required Python libraries:

    pip install -r requirements.txt
  3. 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.

Usage

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"

About

skúška pythonu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages