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: LandTransportSg

Interact with the electric vehicle-related endpoints.

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

Parameters:
  • account_key (str)

  • cache_backend (str | BaseCache)

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:

EVChargingPointsDict

ev_charging_points_batch() str

Get all electric vehicle charging points in Singapore and their availabilities in a single file.

Returns:

Link for downloading the requested file.

Return type:

Url

Argument Types

class landtransportsg.electric_vehicle.EVChargingPointsArgsDict

Bases: TypedDict

Type definition for ev_charging_points() input arguments

postal_code: str

Postal code of the location.

Example:

“123456”

Types

class landtransportsg.electric_vehicle.EVChargingPointsDict

Bases: TypedDict

Type definition for ev_charging_points()

evLocationsData: list[_EVChargingPointsLocationDataDict]

List of EV charging point location data.

class landtransportsg.electric_vehicle._EVChargingPointsLocationDataDict

Bases: TypedDict

Type definition for EVChargingPointsDict

address: str

Address of the charging station.

Example:

“123 Road A Singapore 123456”

name: str

Name of charging station.

Example:

“123 Road A”

longitude: float

Longitude map coordinates of charging station.

Example:

103.123456

latitude: float

Latitude map coordinates of charging station.

Example:

1.123456

locationId: str

Location Id of charging station. Made up from the first 6 decimal places of longitude followed by postal code..

Example:

“123456123456”

status: str | None

Status of charging station.

chargingPoints: list[_EVChargingPointsLocationDataChargingPointDict]

List of charging points.

class landtransportsg.electric_vehicle._EVChargingPointsLocationDataChargingPointDict

Bases: TypedDict

Type 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”

operatingHours: str | None

Operation hours of the charger.

operator: str

Charging operator of the charger.

Example:

“EVCO A”

position: str

Position of the charger.

Example:

“L1 Lot 123”

name: str

Name of the charger.

Example:

“123 Road A”

id: str | None

ID of the charger.

plugTypes: list[_EVChargingPointsLocationDataChargingPointPlugTypeDict]

List of plug types.

class landtransportsg.electric_vehicle._EVChargingPointsLocationDataChargingPointPlugTypeDict

Bases: TypedDict

Type definition for _EVChargingPointsLocationDataChargingPointDict

plugType: str

Plug type of the charging point.

Example:

“Type 2”

powerRating: str

Power rating of the charging point.

Example:

“AC”

chargingSpeed: float

kW.

Example:

7.4

Type:

Charging speed of the charging point. Unit

price: float | None

Charging price, including Value Added Tax.

Example:

0.70

priceType: str | None

Price type of the charging price.

  • “h”

  • “kWh”

Example:

“kWh”

evIds: list[_EVChargingPointsLocationDataChargingPointPlugTypeEVIdDict]

List of plug IDs.

class landtransportsg.electric_vehicle._EVChargingPointsLocationDataChargingPointPlugTypeEVIdDict

Bases: TypedDict

Type definition for _EVChargingPointsLocationDataChargingPointPlugTypeDict

id: str | None

Refer to evCpId.

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”