KentKart GTFS Data Generator & viewer
A product of, "hey, i could probably do this."
Available for viewing @ https://egezenn.github.io/kk-gtfs/map
to run:
git clone https://github.com/Egezenn/kk-gtfs
uv run kk-gtfs.pyusage: kk-gtfs.py [-h] [-r REGION] [-d DELAY] [-f]
Kentkart GTFS Generator
options:
-h, --help show this help message and exit
-r, --region REGION Region code (default: ALL)
-d, --delay DELAY Delay in seconds between requests (default: 0)
-f, --force Force regenerate existing GTFS feed zips
City metadata: https://service.kentkart.com/rl1/api/v2.0/city
Stop & Route list: https://service.kentkart.com/rl1/web/nearest/find?region={region}&lang=tr
Route information: https://service.kentkart.com/rl1/web/pathInfo?region={region}&lang=tr&direction={direction}&displayRouteCode={display_code}
Nearest buses: https://service.kentkart.com/rl1/web/nearest/bus?region={region}&lang=tr&lat={lat}&lng={lon}&busStopId={stop_id}
Because the KentKart API endpoints do not provide all required fields to generate a strictly compliant GTFS feed, the generator enforces the following hardcoded baseline assumptions:
- Agency URL: Defaulted to
https://www.kentkart.com/(agency.txt) (per municipality support mails are sometimes available in city metadata assupportEmail,supportCCEmail) - Agency Timezone: Defaulted to
Europe/Istanbul(agency.txt) - Route Type: Extracted from
routeTypein the route list API (defaults to3- Bus if missing). Kentkart supports various modes including Bus (3), Ferry (4), Tram (0), Funicular (7) and Rail (2) in certain regions like Kocaeli, Antalya, and Gaziantep. - Calendar Dates: Service ID dates are set with a start boundary of the generation date and an end boundary of
+60days (calendar.txt) - Stop Arrivals: The API only provides a time offset from the first stop, so all intermediate arrival and departure times are calculated relative to the trip's starting time.
https://github.com/Egezenn/kk-gtfs/raw/main/data/{municipality}.zip
- GitHub Action workflow fetches and pushes updates every: 1st of every month at 03:00 (UTC+3)
- Data expiry: 2 months after generation at 06:00 (UTC+3)
The source code in this repository is released into the public domain under MIT License.
The GTFS datasets generated by this tool are derived from KentKart API endpoints. The data is licensed under CC0 1.0 Universal Public Domain Dedication. Note that the underlying data and its copyright belongs to its respective owners (KentKart and/or the respective municipal authorities). This dedication only applies to any copyrightable compilation or formatting efforts introduced by this tool.