Skip to main content

Python package for interacting with APIs available at LTA DataMall

Project description

Python 3 PyPi PyPi status 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:

pip install landtransportsg

Using the package

Pre-requisite:

The main steps are:

  1. Import a class.

  2. Instantiate an object from the 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 three clients, where each client corresponds with a set of endpoints.

The four clients are: ActiveMobility, Geospatial, PublicTransport and 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

landtransportsg-1.3.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

landtransportsg-1.3.0-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file landtransportsg-1.3.0.tar.gz.

File metadata

  • Download URL: landtransportsg-1.3.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for landtransportsg-1.3.0.tar.gz
Algorithm Hash digest
SHA256 e7fcdad82275d1c85b5d5da8ada1fddbea1fbc35cf8b8017c8c774ae4ed2fdf2
MD5 c70432169d66b3f27b60f5471c33a0d8
BLAKE2b-256 27e504fe7ebe9e1f489ea9cac59b17d64d255f2b0a377f85df66e342a1df6311

See more details on using hashes here.

File details

Details for the file landtransportsg-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: landtransportsg-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for landtransportsg-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61d2a5507ff29a940658e43962103919c26ceb6452f625f9ea6953139c1bd51f
MD5 3e57960342ce917892714ec04244a250
BLAKE2b-256 a3d089e8660ba92ce60fdc44e5e53c272cf1d26cddcf70f37336e65378fadcfa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page