Skip to main content

datagovsg

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

Installing the package

Install the package using pip:

python -m 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: Economy, Environment, Housing and Transport.

Breaking changes from v1.x

The Economy client used to be called Technology.

The old Transport client has been separated into Housing and Transport.

Data.gov.sg no longer provides endpoints for CKAN, so the Ckan client has been removed.

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 Data.gov.sg uses “Categories” to group its endpoints, 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 2.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 2.1.0
File Size Uploaded Provenance Actions
datagovsg-2.1.0.tar.gz 39.2 kB Without provenance Details for datagovsg-2.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 93.5 kB

Release files / datagovsg-2.1.0.tar.gz

Download URL datagovsg-2.1.0.tar.gz
Size 39.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2d721898b88e7983ad61786d407249e6550dccf56405ad3a7d0abdfe3b6d6aee
BLAKE2b-256 checksum
How to use checksums
640452d97fb68acf16f41194d1d659b60f07083d24e0a43df096a0490e3a94de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

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

Download URL datagovsg-2.1.0-py3-none-any.whl
Size 54.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b52a9f2d5c1b3682f5250f4f26b3e34b34226643c838b962b549ffe033d2f5d
BLAKE2b-256 checksum
How to use checksums
3eb4f6609e145835d90c90a264b93f96f209b8f627b9d0829d62e5fd62135fa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

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