Skip to main content

Python 3.13 PyPi PyPi status CodeCov coverage downloads GNU General Public License v3.0 Documentation Status

This is an unofficial Python package for interacting with APIs available at LTA DataMall.

Installing the package

Install the package using pip:

python -m pip install landtransportsg

Using the package

Pre-requisite:

The main steps are:

  1. Import a client class.

  2. Instantiate an object from the client class.

  3. 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:

  1. ActiveMobility

  2. ElectricVehicle

  3. Geospatial

  4. PublicTransport

  5. 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

LTA DataMall’s Developer Guide

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:

  • datagovsg: for interacting with APIs available at Data.gov.sg.

  • singstat: for interacting with APIs available at SingStat.gov.sg.

Metadata

Release files for landtransportsg 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for landtransportsg 2.2.0
File Size Uploaded Provenance Actions
landtransportsg-2.2.0.tar.gz 41.4 kB Without provenance Details for landtransportsg-2.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for landtransportsg 2.2.0
File Interpreter ABI Platform Actions
landtransportsg-2.2.0-py3-none-any.whl Python 3 none any Details for landtransportsg-2.2.0-py3-none-any.whl

Total release size: 101.2 kB

Release files / landtransportsg-2.2.0.tar.gz

Download URL landtransportsg-2.2.0.tar.gz
Size 41.4 kB
Tags Source
SHA-256 checksum
How to use checksums
eceba1147a0bb7baebb95ae972e3042645316f417f45f76e16324577bf043918
BLAKE2b-256 checksum
How to use checksums
3fc7e1f37a2a8d4c12d4b870e24d1887c05133046a76c2ed6e7df0b6cdc6f3db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / landtransportsg-2.2.0-py3-none-any.whl

Download URL landtransportsg-2.2.0-py3-none-any.whl
Size 59.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc6cfb3929f1828dd805d92e780c9ff8a8e18ea49d2097179b771d2504a42f9c
BLAKE2b-256 checksum
How to use checksums
d0d26d93314236b1247140064b72cfc96d1aa2cb317aee720b7cd9f8cbd41aab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for landtransportsg 2.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page