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.2.0.tar.gz (30.3 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.2.0-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onemap_sg_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 30.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 ad1301f76bfa1837c94ce655157283d18b85ba7d1188faaf825f216b5ec08914
MD5 8eed6391137c732f35ffc6242a673e88
BLAKE2b-256 d26322f54e6c0d79c5d1128eaba00afd462c151a4df32d34fe090a7ab43397b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for onemap_sg_cli-0.2.0.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: onemap_sg_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 32.4 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d0633a142e65991766e8d1f9fdbff1756c914e05b09b581b25aeba0000641fd
MD5 bbd70d89bfdc4123bd61f9547c56c49f
BLAKE2b-256 54ac9adc06babbc0964326bf292105119450f00e243f306e88b55474afbd315a

See more details on using hashes here.

Provenance

The following attestation bundles were made for onemap_sg_cli-0.2.0-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