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:
Import a class.
Instantiate an object from the class.
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
Metadata
Release files for datagovsg 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| datagovsg-2.2.0.tar.gz | 37.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datagovsg-2.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 90.1 kB
Release files / datagovsg-2.2.0.tar.gz
| Download URL | datagovsg-2.2.0.tar.gz |
|---|---|
| Size | 37.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c80ca0c0a4fa52ea10f5cf928bf96853222c61316464eba3f87eef71367d40f7
|
|
BLAKE2b-256 checksum How to use checksums |
63e3b3bd1df306d797d1b48ef8a34046fb7d5514fb8a2e22c754c5294b4d3f9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / datagovsg-2.2.0-py3-none-any.whl
| Download URL | datagovsg-2.2.0-py3-none-any.whl |
|---|---|
| Size | 52.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
135b974acb5505f7679cfe74a884595e433d1128f21b6b02b640ddc7527f362a
|
|
BLAKE2b-256 checksum How to use checksums |
04e303514409c260859528d0115753fb51d440b5939920fbb54d7018f4b1d2dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|