Skip to main content

CLI and Python library for Singapore OneMap APIs — search, geocode, routing, themes, population data, and more

Project description

onemap-sg-cli

CLI and Python library for OneMap Singapore APIs — search, geocode, routing, thematic layers, demographics, and URA property data.

Install

pip install onemap-sg-cli

Or with pipx:

pipx install onemap-sg-cli

Or with uvx (no install needed):

uvx onemap-sg-cli search "Orchard Road"

Setup

Set environment variables (or create a .env file):

export ONEMAP_EMAIL="your@email.com"
export ONEMAP_EMAIL_PASSWORD="your_password"

# Optional: URA property data
export URA_ACCESS_KEY="your_ura_key"

Get credentials:

CLI Usage

# Search
onemap search "Orchard Road"

# Route finding — accepts addresses, postal codes, or lat,lon
onemap route transit "Chinese Garden MRT" "One Raffles Quay"
onemap route transit "Chinese Garden MRT" "One Raffles Quay" --time "09:00"

# Coordinate conversion
onemap convert wgs84-to-svy21 1.342 103.732

# Demographics
onemap pop age "Bedok" 2020

# Nearby transport
onemap nearby mrt 1.342 103.732 --radius 2000

# Static map
onemap map default --lat 1.342 --lon 103.732 -o map.png

See onemap --help for all commands.

Python Library

import asyncio
import onemap_sg

result = asyncio.run(onemap_sg.search("Orchard Road"))
route = asyncio.run(onemap_sg.route_public_transport(
    1.342, 103.732, 1.281, 103.852,
    departure_time="2026-06-08T09:00:00+08:00", mode="TRANSIT",
))

Agent Instructions

One-line install for any AI agent:

# Auto-detect & install to all found agents (recommended)
curl -sSL https://raw.githubusercontent.com/samuelncui/onemap-sg-cli/main/install-agent.sh | bash

# Install to all agents unconditionally
curl -sSL https://raw.githubusercontent.com/samuelncui/onemap-sg-cli/main/install-agent.sh | bash -s all

# Specific agent
curl -sSL https://raw.githubusercontent.com/samuelncui/onemap-sg-cli/main/install-agent.sh | bash -s hermes

Supported: hermes, cursor, claude, cline, copilot, windsurf, aider, agents. Default: auto-detect all.

License

MIT

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

onemap_sg_cli-0.1.1.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onemap_sg_cli-0.1.1-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file onemap_sg_cli-0.1.1.tar.gz.

File metadata

  • Download URL: onemap_sg_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for onemap_sg_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e1a84b263a3fa6e0322088fbe9274bdf20996fcb007b23f3640b3f324e1ab324
MD5 2205b8acdc4e9c2773c493bb708055eb
BLAKE2b-256 a684629e1f3cc5807fca37218ccb139abbf4bca33809f5c89d520ae1fae22105

See more details on using hashes here.

Provenance

The following attestation bundles were made for onemap_sg_cli-0.1.1.tar.gz:

Publisher: workflow.yml on samuelncui/onemap-sg-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onemap_sg_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: onemap_sg_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for onemap_sg_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6cc0e53185c65415074352fc7f8bbe8c2fe46ceb819290160921b2073c43d4ee
MD5 da3b422c823e71422e96e747f62881ee
BLAKE2b-256 cd954c5b549538d6551392523b7637a1b25af675b02281d77a910134313055bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for onemap_sg_cli-0.1.1-py3-none-any.whl:

Publisher: workflow.yml on samuelncui/onemap-sg-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page