Skip to main content

datagovsg

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

Metadata

Release files for datagovsg 1.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 datagovsg 1.0
File Size Uploaded Provenance Actions
datagovsg-1.0.tar.gz 23.4 kB Without provenance Details for datagovsg-1.0.tar.gz

Built distributions (wheels)

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

Total release size: 88.6 kB

Release files / datagovsg-1.0.tar.gz

Download URL datagovsg-1.0.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5c336d2499bad17ffb4d08b0a62db09c6fe738f9d4801ed5e0a76df2077b84e0
BLAKE2b-256 checksum
How to use checksums
d42d9ba3acc4d38fc1900a7e796aa440f403863ad145868a78ef4c2c6aafb71b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / datagovsg-1.0.0-py3-none-any.whl

Download URL datagovsg-1.0.0-py3-none-any.whl
Size 32.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cad5ac8e67f3c4eabc1da66abdf7a427bc0932a77d858d9a29eead8708a5ef49
BLAKE2b-256 checksum
How to use checksums
11a4bcf155a7eab4ce1a00fd3f3e21d94b3a63ef091465f9324b239e5729e395
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / datagovsg-1.0-py3-none-any.whl

Download URL datagovsg-1.0-py3-none-any.whl
Size 32.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4610b404e429f52000777b1a29a6a489981f465d5ed371fd383b48da611e069
BLAKE2b-256 checksum
How to use checksums
ff18b45e243f71b381e649deac7c25521de7f11e3ca990c8f12c62cade6ed739
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Security for datagovsg 1.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