Python wrapper for SLA's OneMap API
Python Wrapper for SLA's OneMap API
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
import onemap_py x = onemap_py.Client("email@example.com", "password") # Search for an address # Note: For address search, no authentication required gh = x.search("GRAND HYATT") gh = gh['results'] # 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'] x.Router.route_from_postal(gh['POSTAL'], changi_airport['POSTAL'], route_type='drive')
Main class that encapsulates all classes defined in other modules.
Clientitself is a subclass of
OneMap, but also has attributes
Provides basic functionality such as address search, coordinate conversion, and authentication.
Provides functionality to query routes between 2 points. Currently supports
Provides functionality to retrieve planning areas, including geospatial boundaries.
Handles all population-related queries, including education level, economic status, work income, marital status etc. Use
Population.available_data_typesto see available data types
For a full list of data provided by OneMap, you can refer to their documentation.
Thematic information from various agencies in Singapore.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size onemap_py-0.2.0-py3-none-any.whl (9.8 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size onemap-py-0.2.0.tar.gz (7.7 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for onemap_py-0.2.0-py3-none-any.whl