Kotlin library for handling GTFS files, with focus on Java interoperability. Requires Java 11+. Supports both parsing and writing GTFS files.
Documentation for latest version is available here.
- Parsing GTFS data from ZIP archives and uncompressed CSV files
- Writing GTFS data to ZIP archives and uncompressed CSV files
- Data classes for GTFS data types
- Properties use corresponding Java types when it makes sense (e.g.
LocalDate
for dates)
- Properties use corresponding Java types when it makes sense (e.g.
- Utilities for handling GTFS date and time values
gtfs-library
is published as a Maven artifact through GitHub packages. See package page for latest version.
Note: GitHub Packages registry must be configured to use the package. See GitHub's documentation for Maven and Gradle for more details.
- Print all stop IDs and names:
val gtfsParser = ZipGtfsFeedParser(Paths.get("gtfs.zip"))
val stops = gtfsParser.parseStops().toList()
stops.forEach { stop ->
println("${stop.stopId} - ${stop.stopName}")
}
gtfsParser.close()