landtransportsg.active_mobility

Active Mobility module.

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(account_key: str)

Bases: Lta

Interact with the active mobility-related endpoints.

References: https://datamall.lta.gov.sg/content/dam/datamall/datasets/LTA_DataMall_API_User_Guide.pdf

Parameters:

account_key (str)

bicycle_parking(latitude: float, longitude: float, distance: float = 0.5) list[BicycleParkingDict | dict]

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) – Radius in kilometres from the latitude-longitude location to retrieve bicycle parking locations. Defaults to 0.5.

Raises:

ValueError – distance is a negative float.

Returns:

Available bicycle parking locations at the specified location.

Return type:

list[BicycleParkingDict]

Types

class landtransportsg.active_mobility.BicycleParkingDict

Bases: TypedDict

Type definition for bicycle_parking()

Description: str

Brief description of bicycle parking location. Example: “Bus Stop 43267”.

Latitude: float

Latitude map coordinates of bicycle parking location. Example: 1.3927176306916775.

Longitude: float

Longitude map coordinates of bicycle parking location. Example: 103.82618266340947.

RackType: str

Type of bicycle parking facility. Example: “Racks or Yellow Box”.

RackCount: int

Total number of bicycle parking lots. Example: 10.

ShelterIndicator: str

Indicate whether the bicycle parking lots are sheltered. Example: “Y”.