Python package for interacting with APIs available at Data.gov.sg
Project description
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:
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: 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
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
Built Distribution
Hashes for datagovsg-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb71ead390652d5097aa96bc1a053269824042ec6c58a4d7790fef0f9d4987b9 |
|
MD5 | ef97d6f02b4b7bc866f71ad2756f6300 |
|
BLAKE2b-256 | 39806ae4878dac956b7956b36cea3430f7390778747ebf3060f4aa5cd0c3d043 |