datagovsg.transport

Client for interacting with the Transport APIs.

Example usage:

# get the list of available car park spaces
from datagovsg import Transport
transport = Transport()
carpark_availability = transport.carpark_availability()

Methods

class datagovsg.transport.client.Client

Bases: datagovsg.client.__Client

Interact with the transport-related endpoints.

carpark_availability(date_time=None)

Get the latest carpark availability in Singapore.

Parameters

date_time (datetime) – (optional) Specific date-time to retrieve the availabilities at that time. Can be in any timezone (will be standardised to SGT.)

Returns

(dict) Available carpark spaces.

References

https://data.gov.sg/dataset/carpark-availability

taxi_availability(date_time=None)

Get locations of available taxis in Singapore.

Parameters

date_time (datetime) – (optional) Specific date-time to retrieve the availabilities at that time. Can be in any timezone (will be standardised to SGT.)

Returns

(dict) GeoJSON of the taxi availabilities.

References

https://data.gov.sg/dataset/taxi-availability

traffic_images(date_time=None)

Get the latest images from traffic cameras all around Singapore.

Parameters

date_time (datetime) – (optional) Specific date-time to retrieve the images at that time. Can be in any timezone (will be standardised to SGT.)

Returns

(dict) Images from traffic cameras.

References

https://data.gov.sg/dataset/traffic-images