Creates GTFS/GTFS-Realtime data feed for Gdańsk and Gdynia.
Data comes from Open Gdańsk project and Gdynia open data project.
The script can also generate shapes.txt for Gdynia shcedules, which whill in turn use data from © OpenStreetMap contributors.
- Produced feed will use extended type 800 for trolleybuses.
- Data is created up to last day, when schedules are avialable for all agencies.
- Both ZTM Gdańsk and ZKM Gdynia data sources share their data under CC BY license, so you have to credit them.
This can be done by exposing the data from
service_ids could collide
between ZTM Gdańsk and ZKM Gdynia data sources,
service_id is prefixed with
1: for ZTM Gdańsk data and
2: for ZKM Gdynia data.
As of the time writing the stop merge table
references unexisting stops — it is not used.
All ZTM Gdańsk
stop_ids are asserted to be < 30000 and all ZKM Gdynia
stop_ids are asserted to be >= 30000.
Of course you will need Python3 (version 3.6 or later), with these modules:
Before launching install required modules with
pip3 install -r requirements.txt
Each script can launch without any command line options, but you may want to take a look at them.
Static GTFS - tristargtfs.py
python3 tristargtfs.py - Creates GTFS file in
gtfs.zip without shapes.
- -o / --output-file TARGET-PATH-OF-GTFS.zip: Destination path of the gtfs archive,
- -s / --shapes: Use OSM to gerenate shapes for ZKM Gdynia + copy ZTM Gdańsk shapes.
Realtime GTFS - tristargtfs_realtime.py
python3 tristargtfs_realtime.py - Creates binary GTFS-RT file in
gtfs-rt.pb for mkuran.pl Tristar GTFS
- -o / --output-file TARGET-PATH-OF-GTFS-RT.pb: Destination of gtfs-realtime file,
- --gtfs PATH-OR-URL-TO-GTFS: Path/URL to the Tristar GTFS file to use as a base for RT data,
- --readable: Output data to a human-readable protobuff instead of binary one,
- --debug: Do some more printing when there are issues with encountered data,
- -l / --loop: Run the script in a loop - autmoatically update the taget-file,
- -p / --peroid SECONDS: How often should the target-file should be updated (for --loop, default 30s),
- --gtfs-check-peroid SECONDS: How often should the script check if gtfs file has changed (for -loop, default 1800s/30min).
TristarGTFS is provided under the MIT license, included in the