{"id":21481899,"url":"https://github.com/methyldragon/onemapsg-api-client","last_synced_at":"2025-07-15T12:33:43.906Z","repository":{"id":35008558,"uuid":"172497498","full_name":"methylDragon/onemapsg-api-client","owner":"methylDragon","description":"Python Wrapper Client for the OneMap API 🗺️📌","archived":false,"fork":false,"pushed_at":"2024-04-19T19:07:35.000Z","size":49,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-09T14:32:45.269Z","etag":null,"topics":["api","client","client-library","onemap","python","python3","singapore"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/onemapsg/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/methylDragon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-25T11:58:26.000Z","updated_at":"2024-06-18T03:19:42.000Z","dependencies_parsed_at":"2022-07-24T20:16:28.793Z","dependency_job_id":null,"html_url":"https://github.com/methylDragon/onemapsg-api-client","commit_stats":null,"previous_names":["methyldragon/one-map-api-client"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/methylDragon%2Fonemapsg-api-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/methylDragon%2Fonemapsg-api-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/methylDragon%2Fonemapsg-api-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/methylDragon%2Fonemapsg-api-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/methylDragon","download_url":"https://codeload.github.com/methylDragon/onemapsg-api-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226042699,"owners_count":17564704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","client","client-library","onemap","python","python3","singapore"],"created_at":"2024-11-23T12:28:51.013Z","updated_at":"2024-11-23T12:28:51.813Z","avatar_url":"https://github.com/methylDragon.png","language":"Python","funding_links":["https://www.buymeacoffee.com/methylDragon","https://www.paypal.me/methylDragon"],"categories":[],"sub_categories":[],"readme":"# OneMap API Client\n\n[![PyPI version](https://badge.fury.io/py/onemapsg.svg)](https://badge.fury.io/py/onemapsg)\n\nPython Wrapper Client for the OneMap API\n\n![img](assets/logo.png)\n\n\n\nDocs here: https://docs.onemap.sg/\n\nPyPI Link: \u003chttps://pypi.org/project/onemapsg/\u003e\n\nRegister for an API key here: https://developers.onemap.sg/signup/\n\n\n\nThis client:\n\n- Authenticates for a valid API token, and refreshes as needed!\n- Returns everything as a nice dictionary!\n\n\n\n## Example Usage\n\n```python\nfrom onemapsg import OneMapClient\n\nClient = OneMapClient(\"YOUR_EMAIL\", \"YOUR_PASSWORD\")\n\nClient.search(\"Dragon View Park\")\n# Result\n'''\n{'found': 1,\n 'totalNumPages': 1,\n 'pageNum': 1,\n 'results': [{'SEARCHVAL': 'DRAGON VIEW PARK',\n   'BLK_NO': '',\n   'ROAD_NAME': 'NIL',\n   'BUILDING': 'DRAGON VIEW PARK',\n   'ADDRESS': 'DRAGON VIEW PARK SINGAPORE',\n   'POSTAL': 'NIL',\n   'X': '27415.382888752',\n   'Y': '31015.7030415982',\n   'LATITUDE': '1.29676950856585',\n   'LONGITUDE': '103.828065538017',\n   'LONGTITUDE': '103.828065538017'}]}\n'''\n```\n\n\n\n## Installation\n\n```shell\npip install onemapsg\n```\n\n\n\n## Credits\n\n- The OneMap team for a pretty nice API\n\n- Author: methylDragon\n\n\n\n## Support my efforts!\n\n [![Yeah! Buy the DRAGON a COFFEE!](./assets/COFFEE%20BUTTON%20%E3%83%BE(%C2%B0%E2%88%87%C2%B0%5E).png)](https://www.buymeacoffee.com/methylDragon)\n\n[Or leave a tip! ヾ(°∇°*)](https://www.paypal.me/methylDragon)\n\n\n\n## Client Interface\n\nIncludes the full API as of February 2019, also supports a general API query in case of client depreciation:\n\n**Client Specific**\n\n- Initialise Client\n\n  - `Client = OneMapClient(email, password)`\n\n    Generates token on init\n\n- Generate New Token\n\n  - `get_token(email=None, password=None)`\n\n    *Returns:*\n\n    token, expiry\n\n- General Query\n\n  - `query_api(endpoint, param_dict)`\n\n\n\n## Class Methods\n\nRemember to use them as such! `Client.method()`\n\n**Location Search**\n\n- Search\n  - `search(search_val, return_geom=True, get_addr_details=True, page_num=1))`\n- Reverse Geocode (SVY21 and WGS84)\n  - `reverse_geocode_SVY21(coordinates, buffer=10, address_type=\"All\", other_features=False)`\n  - `reverse_geocode_WGS84(coordinates, buffer=10, address_type=\"All\", other_features=False)`\n\n**Coordinate Conversion**\n\n- All converters between WGS84, SVY21, and 3857\n  - `WGS84_to_EPSG(coordinates)`\n  - `WGS84_to_SVY21(coordinates)`\n  - `SVY21_to_EPSG(coordinates)`\n  - `SVY21_to_WGS84(coordinates)`\n  - `EPSG_to_SVY21(coordinates)`\n  - `EPSG_to_WGS84(coordinates)`\n\n**Themes**\n\n- Check Theme Status\n  - `check_theme_status(query_name, date_time)`\n- Get Theme Info\n  - `get_theme_info(query_name)`\n- Get all Themes\n  - `get_all_themes_info(more_info=False)`\n- Retrieve Themes\n  - `retrieve_theme(query_name, extents=None)`\n\n**Planning Areas**\n\n- Get all Planning Areas\n  - `get_all_planning_areas(year=None)`\n- Get Planning Area Names\n  - `get_planning_area_names(year=None)`\n- Get Planning Area Bounds\n  - `get_planning_area_bounds(coordinates, year=None)`\n\n**Population Queries**\n\n- Economic Statuses\n  - `get_economic_statuses(year, planning_area, gender=None)`\n- Education Attendance\n  - `get_education_attendance(year, planning_area)`\n- Ethnic Groups\n  - `get_ethnic_groups(year, planning_area, gender=None)`\n- Work Income For Household (Monthly)\n  - `get_household_monthly_work_income(year, planning_area)`\n- Household Size Data\n  - `get_household_sizes(year, planning_area)`\n- Household Structure Data\n  - `get_household_structures(year, planning_area)`\n- Income from Work Data\n  - `get_work_income(year, planning_area)`\n- Population of Industries\n  - `get_industries(year, planning_area)`\n- Language Literacy Data\n  - `get_language_literacy(year, planning_area)`\n- Marital Status Data\n  - `get_marital_statuses(year, planning_area, gender=None)`\n- Mode of Transports to School Data\n  - `get_modes_of_transport_to_school(year, planning_area)`\n- Mode of Transport to Work Data\n  - `get_modes_of_transport_to_work(year, planning_area)`\n- Occupation Data\n  - `get_occupations(year, planning_area)`\n- Age Data\n  - `get_age_groups(year, planning_area)`\n- Religion Data\n  - `get_religious_groups(year, planning_area)`\n- Spoken Language Data\n  - `get_spoken_languages(year, planning_area)`\n- Tenancy Data\n  - `get_tenancy(year, planning_area)`\n- Dwelling Type Household Data\n  - `get_dwelling_types(year, planning_area)`\n- Dwelling Type Population Data\n  - `get_population_by_dwelling_types(year, planning_area)`\n\n**Routing Service**\n\n- Get Route\n  - `get_route(start_coordinates, end_coordinates, route_type)`\n- Get Public Transport Route\n  - `get_public_transport_route(start_coordinates, end_coordinates, date, time, mode, max_walk_distance=None, num_itineraries=1)`\n\n**Static Map Generator**\n\n- Generate Static Map\n  - `generate_static_map(layer_chosen, location, zoom, width, height, polygons=None, lines=None, points=None, color=None, fill_color=None)`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmethyldragon%2Fonemapsg-api-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmethyldragon%2Fonemapsg-api-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmethyldragon%2Fonemapsg-api-client/lists"}