landtransportsg.active_mobility

Client for interacting with the Active Mobility API endpoints.

Example usage:

# get the bicycle parking locations
from landtransportsg import ActiveMobility
client = ActiveMobility(API_KEY)
bicycle_parking_locations = client.bicycle_parking(1.364897, 103.766094)

Methods

class landtransportsg.active_mobility.client.Client(account_key)

Bases: landtransportsg.client.__Client

Interact with the active mobility-related endpoints.

References

https://www.mytransport.sg/content/dam/datamall/datasets/LTA_DataMall_API_User_Guide.pdf

bicycle_parking(latitude, longitude, distance=0.5)

Get bicycle parking locations within a radius.

Parameters
  • latitude (float) – Latitude map coordinates of a location.

  • longitude (float) – Longitude map coordinates of a location.

  • distance (float) – (optional) Radius in kilometres from the latitude-longitude location to retrieve bicycle parking locations. Default: 0.5.

Returns

(list) Available bicycle parking locations at the specified location.

Raises

ValueError – If latitude, longitude or distance are not floats.