Skip to content

Python client for fetching estimated departures from stop places in Norway from Entur.org's API.

License

Notifications You must be signed in to change notification settings

palhaland/enturclient

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Entur API client

Python client for fetching estimated departures from stop places in Norway from Entur.org's API. Information about stop places, platforms and real-time departures.

Buy me a coffee

Usage

from enturclient import EnturPublicTransportData
import enturclient.consts

API_CLIENT_ID = 'awesome-company-application'

stops = ['NSR:StopPlace:548']
quays = ['NSR:Quay:48550']
data = EnturPublicTransportData(
        API_CLIENT_ID,
        stops,
        quays,
        False)
data.update()

bergen_train = data.get_stop_info('NSR:StopPlace:548')
bergen_train_delay = bergen[consts.ATTR][consts.ATTR_DELAY]

Obtaining a stop id

Entur's travel planer has a map of all stops used in Norway. Use the map to find the stops you're interested in. When you have found one of your stops, click on it. Now the web browser should contain an URL with the id in it. Such as this: https://en-tur.no/nearby-stop-place-detail?id=NSR:StopPlace:32376 The stop id is the content after id= parameter in the url. Copy paste this into the configuration.

About

Python client for fetching estimated departures from stop places in Norway from Entur.org's API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%