unsprawl.providers.data.sg.govsg¶
unsprawl.providers.data.sg.govsg.
GovSGProvider is a dumb fetcher for Singapore open datasets.
Responsibilities¶
Talk to data.gov.sg (initiate-download endpoint)
Download the dataset artifact to the local cache (~/.unsprawl/data)
Fall back to synthetic datasets if the network/API fails
Non-responsibilities¶
No knowledge of
Assetor the core simulation schema.No Singapore-specific valuation logic.
NOTE(judge)¶
This provider is a canonical example of our global platform architecture: API I/O is isolated from normalization (adapter layer) and from physics (core).
Attributes¶
Classes¶
Dataset identifiers for data.gov.sg initiate-download API. |
|
Provider for Singapore open data via data.gov.sg. |
Functions¶
Return the default dataset cache root (~/.unsprawl/data). |
|
|
Hit the initiate-download endpoint to get the temporary URL. |
|
Stream a remote file to disk. |
|
Generate a synthetic resale dataset for deterministic offline usage. |
Generate a synthetic MRT exits GeoJSON. |
Module Contents¶
- EXPECTED_RESALE_COLUMNS¶
- _default_data_root()[source]¶
Return the default dataset cache root (~/.unsprawl/data).
Uses ~ expansion to remain portable across OSes.
- _api_get_download_url(dataset_id, *, timeout_s=30.0)[source]¶
Hit the initiate-download endpoint to get the temporary URL.
- _generate_synthetic_resale_csv(path, *, limit=5000)[source]¶
Generate a synthetic resale dataset for deterministic offline usage.
- class GovSGProvider(*, data_root=None, dataset_ids=None)[source]¶
Provider for Singapore open data via data.gov.sg.
- data_root¶
- dataset_ids¶