No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-04 19:11:32 +02:00
database Add realtime position to database 2026-10-04 19:11:32 +02:00
.gitignore Initial commit 2026-08-07 15:12:40 +02:00
get_rmv.py Add realtime position to database 2026-10-04 19:11:32 +02:00
prepare_rmv_keys.py Add realtime position to database 2026-10-04 19:11:32 +02:00
README.md Fix date fetching, updating requirements and small refactor of Journey 2026-08-08 22:41:45 +02:00
requirements.txt Fix date fetching, updating requirements and small refactor of Journey 2026-08-08 22:41:45 +02:00
station_ids.json New json format including timestamps 2026-09-07 00:46:31 +02:00

seb-bahn-py

This repository holds the python script to get current live data from rmv api and get the relevant journey ids for each trip based on the dienstplan.

Credits to seb for creating the pdf extractor.

Usage

For both scripts, you need to have a rmv api key in your environment as RMV_API_KEY. And you need the python packages of requirements.txt. (This file was created automatically, you need to have at least requests and camelot-py)

Preparation

Before running the actual tracker script, you need to create (or fill) the journey_ids.json. For that purpose, there exists the script prepare_rmv_keys.py.

  1. Put the dienstplan as dienstplan.pdf in this directory
  2. Make sure that you have station_ids.json with all relevant stations.
  3. Make sure to have a file called journey_ids.json with at least {}
  4. Run
python prepare_rmv_keys.py

This script outputs the signal message (done by sebi) and fills in the journey_ids.json in the background. This json file can be simply out on the server to be tracked automatically. The date is included to reduce the number of api calls to only the journeys of today.

Tracker

To track the journeys created by prepare_rmv_keys.py, you can use the script get_rmv.py.

  1. Make sure to have the file journey_ids.json in the same directory as get_rmv.py
  2. Make sure to have a directory called jsons in the same directory.
  3. Run
python get_rmv.py