Python package for interacting with APIs available at LTA DataMall
Project description
This is an unofficial Python package for interacting with APIs available at LTA DataMall.
Installing the package
Install the package using pip:
pip install landtransportsg
Using the package
Pre-requisite:
API key from LTA. Request for API access.
The main steps are:
Import a client class.
Instantiate an object from the client class.
Call a function on that object.
For more information, refer to the documentation.
Usage overview
Interacting with LTA DataMall’s API is done through one of four clients, where each client corresponds with a set of endpoints.
The five clients are:
ActiveMobility
ElectricVehicle
Geospatial
PublicTransport
Traffic
Each client contains several public functions, one function per endpoint. A function’s name is the same as its corresponding endpoint’s ending path.
Some functions accept named arguments, where an argument corresponds with a parameter that the endpoint accepts.
Why have separate clients instead of one single client?
Without knowing how LTA DataMall’s API will evolve, and noticing that the endpoints were themselves already partitioned into sets, it seemed like a good idea to keep each set of endpoints in its own contextual client. This allows for each set of endpoints to be customised on their own, e.g. the PublicTransport passenger volume-related endpoints allow for a string to be returned, whereas the other endpoints return a list.
Reference
Other Packages Built by Me
If you like this package, you may be interested in these packages that I have built to work with other Government of Singapore APIs:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file landtransportsg-2.1.0.tar.gz.
File metadata
- Download URL: landtransportsg-2.1.0.tar.gz
- Upload date:
- Size: 39.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
163a1f925cc6f9faa7c5d8c3c352e8410ed3bf3f1b9041dc23be080d38d8b667
|
|
| MD5 |
0308d703df6cca6b3a7c8117446e3c4c
|
|
| BLAKE2b-256 |
39547222e89cc112716ddfef51a156986921c8d36b7612cb8f788d146ecb606f
|
File details
Details for the file landtransportsg-2.1.0-py3-none-any.whl.
File metadata
- Download URL: landtransportsg-2.1.0-py3-none-any.whl
- Upload date:
- Size: 58.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f692c6a4980f725719f1ba2a05eab7f7cd1dfe79b1a99ebc39b6aa556890eef
|
|
| MD5 |
4cc5f1f628cfda5cfaf888548744fdca
|
|
| BLAKE2b-256 |
84bac76cb7884a996d1c72b49e9212f65d1c605187d033ebbb6bbac1c21e4a80
|