Python Wrapper for SLA's OneMap API
Introduction
This package provides a simple way to query data using the OneMap API in Python.
OneMap arranges its API endpoints by groups, and this package is organized to reflect that grouping.
onemap-py allows you to make queries corresponding to the OneMap API, and returns the results to you in a standard
python dict.
Sample Usage
import onemap_py
x = onemap_py.Client("email@hostname.com", "password")
# Search for an address
# Note: For address search, no authentication required
gh = x.search("GRAND HYATT")
gh = gh['results'][0] # Take the first result
# For other queries, need to authenticate
x.authenticate() # if email and password were None, interactive prompt
# Get planning area for Grand Hyatt
planning_area = x.PlanningAreas.find_planning_area(gh['LATITUDE'], gh['LONGITUDE'])
planning_area = planning_area['pln_area_n'] # Get the name
# Get some population-related information for the planning area
avail_data = x.Population.available_data_types # find all available data types supported by the OneMap API
x.Population.get_population_data("age", year = 2018, planning_area=planning_area)
# Get route from Grand Hyatt to, say, Changi Airport Terminal 3
x.Router.supported_route_types # ['walk', 'drive', 'cycle', 'pt']
changi_airport = x.search("CHANGI AIRPORT TERMINAL 3")['results'][0]
x.Router.route_from_postal(gh['POSTAL'], changi_airport['POSTAL'], route_type='drive')
Details
Client:
Main class that encapsulates all classes defined in other modules.
Clientitself is a subclass ofOneMap, but also has attributesRouter,PlanningAreas,Population, andThemes.
base.OneMap
Provides basic functionality such as address search, coordinate conversion, and authentication.
routing.Router
Provides functionality to query routes between 2 points. Currently supports
(lat,lng)->(lat,lng)orpostal->postal
planning_areas.PlanningAreas
Provides functionality to retrieve planning areas, including geospatial boundaries.
population.Population
Handles all population-related queries, including education level, economic status, work income, marital status etc. Use
Population.available_data_typesto see available data typesFor a full list of data provided by OneMap, you can refer to their documentation.
themes.Themes
Thematic information from various agencies in Singapore.
Metadata
Release files for onemap-py 0.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 | Provenance | Actions |
|---|---|---|---|---|
| onemap-py-0.2.0.tar.gz | 7.7 kB | Without provenance | Details for onemap-py-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onemap_py-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for onemap_py-0.2.0-py3-none-any.whl |
Total release size: 17.5 kB
Release files / onemap-py-0.2.0.tar.gz
| Download URL | onemap-py-0.2.0.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8841328ed74f8b2f9927b7be0b97990b3950588dc5b9e85fee33fa5b21d78b57
|
|
BLAKE2b-256 checksum How to use checksums |
9fb71f526ad7e6341f0b8143c0f40f26b9fd27bba044eebf1b82a2328450c3e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.10 CPython/3.6.6 Windows/10
|
Release files / onemap_py-0.2.0-py3-none-any.whl
| Download URL | onemap_py-0.2.0-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e73d2a98de1d75b0aeb52cf828318b77b4d2ef4768bd55acb757ecb2710bee4c
|
|
BLAKE2b-256 checksum How to use checksums |
37eebe0d073569681882a4c02fc12307eb66f688bca080d20585737382038dfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.10 CPython/3.6.6 Windows/10
|
Security for onemap-py 0.2.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.