Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/schildbach/public-transport-enabler
Unleash public transport data in your Java project.
https://github.com/schildbach/public-transport-enabler
efa hafas java library navitia public-transportation
Last synced: 2 days ago
JSON representation
Unleash public transport data in your Java project.
- Host: GitHub
- URL: https://github.com/schildbach/public-transport-enabler
- Owner: schildbach
- License: gpl-3.0
- Created: 2013-05-27T15:31:24.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T12:24:55.000Z (4 months ago)
- Last Synced: 2024-10-29T20:38:55.277Z (about 2 months ago)
- Topics: efa, hafas, java, library, navitia, public-transportation
- Language: Java
- Homepage: https://groups.google.com/forum/#!forum/public-transport-enabler-discuss
- Size: 6.2 MB
- Stars: 388
- Watchers: 19
- Forks: 133
- Open Issues: 172
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
- open-sustainable-technology - Public Transport Enabler - Unleash public transport data in your Java project. (Consumption / Mobility and Transportation)
README
Public Transport Enabler
========================This is a Java library allowing you to get data from public transport providers.
Look into [NetworkProvider.java](https://github.com/schildbach/public-transport-enabler/blob/master/src/de/schildbach/pte/NetworkProvider.java) for an overview of the API.Using providers that require secrets
------------------------------------For some providers a secret like an API key is required to use their API.
Copy the `secrets.properties.template` file to `secrets.properties` like so:$ cp test/de/schildbach/pte/live/secrets.properties.template test/de/schildbach/pte/live/secrets.properties
You need to request the secrets directly from the provider.
How to run live tests?
----------------------Make sure the test you want to run does not require a secret and if it does, see above for how to get one.
Once you have the secret or if your provider does not need one, you can run the tests in your IDE.
Both IntelliJ and Eclipse have excellent support for JUnit tests.If you prefer to run tests from the command line, you can comment out the test exclude at the end of
[build.gradle](https://github.com/schildbach/public-transport-enabler/blob/master/build.gradle#L30)
and use this command to only execute a test for a single provider:$ gradle -Dtest.single=BvgProviderLive test
This uses the `BvgProvider` as an example.
Just replace it with the provider you want to test.