Skip to main content

Python package for interacting with APIs available at Data.gov.sg

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 Data.gov.sg.

Installing the package

Install the package using pip:

pip install datagovsg

Using the package

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 Data.gov.sg’s API is done through one of four clients, where each client corresponds with a “set” of endpoints. (Data.gov.sg doesn’t categorise its endpoints by set, but it can be assumed from the endpoints’ path directories.)

The four clients are: Ckan, Environment, Technology and Transport.

Each client contains several public functions, one function per endpoint. A function’s name is the same as its corresponding endpoint’s ending path.

Most 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 Data.gov.sg’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 Environment endpoints allow for either a date or date-time to be specified, whereas the Transport endpoints don’t.

Reference

Data.gov.sg’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

datagovsg-1.0.3.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

datagovsg-1.0.3-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file datagovsg-1.0.3.tar.gz.

File metadata

  • Download URL: datagovsg-1.0.3.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for datagovsg-1.0.3.tar.gz
Algorithm Hash digest
SHA256 1782ce9402182827ee7132693094df5420d1e27b1fefd1875e8c56b13167e19f
MD5 44da350981d9d5f2894fcee70defd68b
BLAKE2b-256 ffea1ec45a46717c46d6eb1c9508b905565a6a9ef1b9bcf74303e95dec51f4e8

See more details on using hashes here.

File details

Details for the file datagovsg-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: datagovsg-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 32.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for datagovsg-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ae0b8f4dc6b4093cf2e37dedd5821f54178e422bc8f2c1782d2b070733ca7736
MD5 be400ef70c3724980e589b344cbdc6ee
BLAKE2b-256 a142aff2b5ddfd34f714da1c8ba93a04d1b902c4aab177657130debce5f931b5

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