Skip to content
This repository has been archived by the owner on Jul 17, 2021. It is now read-only.

cebamps/stib-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A STIB-MIVB API client library

Featuring automated OAuth2 token requests.

Does not handle errors elegantly --- use with caution, conform to the STIB-MIVB API documentation, and respect throttling.

from stib_api import StibClient

api = StibClient(
    client_id=CLIENT_ID,          # Obtained from
    client_secret=CLIENT_SECRET,  # https://opendata.stib-mivb.be/store/subscriptions
)

# Save the GTFS file to disk
api.save_gtfs('/tmp/gtfs.zip')

# Save the ESRI shapefiles to disk
api.save_shapefiles('/tmp/shapefiles.zip')

# Get vehicle position JSON (as officially documented) as a dict
positions = api.get_vehicle_positions(['1', '5'])

About

STIB-MIVB API client library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages