landtransportsg.electric_vehicle¶
Electric Vehicle module.
Example usage:
# get the EV charging points
from landtransportsg import ElectricVehicle
client = ElectricVehicle(API_KEY)
ev_charging_points = client.ev_charging_points('219428')
Methods¶
- class landtransportsg.electric_vehicle.Client(account_key: str, cache_backend: str | BaseCache = 'sqlite')¶
Bases:
LandTransportSgInteract with the electric vehicle-related endpoints.
References: https://datamall.lta.gov.sg/content/dam/datamall/datasets/LTA_DataMall_API_User_Guide.pdf
- ev_charging_points(**kwargs: Unpack[EVChargingPointsArgsDict]) EVChargingPointsDict¶
Returns electric vehicle charging points in Singapore and their availabilities.
- Parameters:
kwargs (EVChargingPointsArgsDict) – Key-value arguments to be passed as parameters to the endpoint URL.
- Raises:
ValueError – postal_code is not a 6-digit string.
- Returns:
Available EV charging points at the specified location.
- Return type:
Argument Types¶
Types¶
- class landtransportsg.electric_vehicle.EVChargingPointsDict¶
Bases:
TypedDictType definition for ev_charging_points()
- evLocationsData: list[_EVChargingPointsLocationDataDict]¶
List of EV charging point location data.
- class landtransportsg.electric_vehicle._EVChargingPointsLocationDataDict¶
Bases:
TypedDictType definition for EVChargingPointsDict
- locationId: str¶
Location Id of charging station. Made up from the first 6 decimal places of longitude followed by postal code..
- Example:
“123456123456”
- chargingPoints: list[_EVChargingPointsLocationDataChargingPointDict]¶
List of charging points.
- class landtransportsg.electric_vehicle._EVChargingPointsLocationDataChargingPointDict¶
Bases:
TypedDictType definition for EVChargingPointsDict
- status: str¶
Current status of the charger.
“0” - Occupied. All charging points are occupied.
“1” - Available. At least one charging point is available.
“100” - Not Available. All charging points are not available.
- Example:
“1”
- plugTypes: list[_EVChargingPointsLocationDataChargingPointPlugTypeDict]¶
List of plug types.
- class landtransportsg.electric_vehicle._EVChargingPointsLocationDataChargingPointPlugTypeDict¶
Bases:
TypedDictType definition for _EVChargingPointsLocationDataChargingPointDict
- evIds: list[_EVChargingPointsLocationDataChargingPointPlugTypeEVIdDict]¶
List of plug IDs.
- class landtransportsg.electric_vehicle._EVChargingPointsLocationDataChargingPointPlugTypeEVIdDict¶
Bases:
TypedDictType definition for _EVChargingPointsLocationDataChargingPointPlugTypeDict
- evCpId: str¶
Connector ID. Assigned by LTA during charger registration. EV Charger Registration Code makes up first 8 characters.
- Example:
“R123456A-001”
- status: str | None¶
Current status of the charger.
- “0” - Occupied. Includes following OCPI statuses:
CHARGING
RESERVED
BLOCKED
- “1” - Available. Includes the following OCPI statuses:
AVAILABLE
- “None” - Not Available. Includes the following OCPI statuses:
OUTOFORDER
INOPERATIVE
UNKNOWN
PLANNED
REMOVED
- Example:
“1”