MuoVErsi is a web service that parses and serves timetables of buses, trams, trains and waterbusses. As of now, it supports Venice, Italy's public transit system (by using public GTFS files) and Trenitalia trains within 100km from Venice (parsed from the Trenitalia api). However, since it can build on any GTFS file, it will be easily extended to other cities in the future.
Separated from the core code and optional to set up, a Telegram bot uses the web service to provide a more user-friendly interface. You can check it out here: @MuoVErsiBot. Also, the mobile app for Android and iOS is under active development: muoversi-app.
MuoVErsi allows you to get departure times from a given stop or location, or starting from a specific line. You can then use filters to get the right results and see all the stops/times of that specific route.
When new data is parsed and saved to the database, stops are not simply stored as-is, but they are clustered by name and location. This way it is easier to search for bus stations with more than one bus stop. For example, "Piazzale Roma" has 15 different bus stops from the GTFS file, but they are all clustered together.
- Python 3
- PostgreSQL 16.1 for the database
- Packages contained in
requirements.txt
- node-gtfs installed globally
- Typesense for the stop search engine
- Telegram bot token if you also want to run the bot
- Download the repo and install the dependencies with
pip install -r requirements.txt
. - Fill out the config file
config.example.yaml
and rename it toconfig.yaml
. If you don't want to run the Telegram, bot, setTG_BOT_ENABLED
toFalse
and skip the all the variables starting withTG_
. You won't need thetgbot
folder. - Run PostgreSQL migrations with
alembic upgrade head
. - Run the server by executing
run.py
. For saving data from the GTFS files and, more importantly, for the parsing and saving of Trenitalia trains, make sure you schedule the execution ofsave_data.py
once a day. As of now, also a daily restart ofrun.py
is required to set the service calendar to the current day.