Home

Awesome

KPublicTransport

A library for accessing realtime public transport data and for performing public transport journey queries.

This includes:

!! Before using this, please read the license compliance and attribution section below !!

Data Model

The key elements are:

Supported Operations

All operations can be started from KPublicTransport::Manager with an API similar to QNetworkAccessManager.

Onboard API access is available via the KPublicTransport::OnboardStatus class.

Backends

All data is retrieved from online backend services, this library is not offline capable. The following Free Software/Open Data backend types are supported:

Additionally, a few proprietary/vendor-specific backends are supported too though.

Configurations for about 70 backend services can be found in 'src/lib/networks'. Backend service configations follow the Transport API Repository format.

License Compliance and Attribution

When using the data retrieved by this library you need to comply with the license terms of the backends this is coming from, in particular https://www.navitia.io/api-term-of-use.

Attribution information that need to be displayed in an appropriate place in the application using this are provided globally via KPublicTransport::Manager::attributions() as well as more fine-grained per query reply via KPublicTransport::Reply::attributions().

Besides attributing backend data correctly, this library also contains static data retrieved from Wikidata licensed as CC0 as well as data from OpenStreetMap licensed as ODbL, so those should be appropriately credited in your application as well.

Development

Setting the KPUBLICTRANSPORT_LOG_DIR environment variable will result in all network operations being logged there, grouped by backend, and including the full network traffic. This is useful for example to capture rare scenarios not parsed correctly yet, or for exploring what additional information is available that KPublicTransport does not expose yet.