Skip to content
Creates GTFS feed for ZTM Gdańsk and ZKM Gdynia from Gdańsk's open data
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



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.

Some precautions

  • 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 feed_info.txt file, columns feed_provider_name, feed_publisher_url and feed_version.


Because route_ids, trip_ids and service_ids could collide between ZTM Gdańsk and ZKM Gdynia data sources, each route_id, trip_id and 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.


First Launch

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 -

python3 - Creates GTFS file in without shapes.


  • -o / --output-file Destination path of the gtfs archive,
  • -s / --shapes: Use OSM to gerenate shapes for ZKM Gdynia + copy ZTM Gdańsk shapes.

Realtime GTFS -

python3 - Creates binary GTFS-RT file in gtfs-rt.pb for 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 file.

You can’t perform that action at this time.