Skip to main content

Easy access to global administrative boundaries and geometries via Overture Maps data

Project description

wkls: Well-Known Locations

PyPI version PyPI downloads Python versions License CI

wkls gives you administrative boundaries — countries, regions, counties, and cities — in one line of Python.

import wkls

wkls.us.ca.sanfrancisco.wkt()
# "MULTIPOLYGON (((-122.5279985 37.8155806...)))"
  • Chainable attribute access to countries, states, counties, and cities
  • Precise geometries from Overture Maps Foundation — no bounding boxes, no shapefiles
  • Outputs boundaries in WKT, WKB, or GeoJSON
  • Support for HexWKB and SVG planned
  • Zero configuration — no API keys, no downloads, no setup
  • Automatically uses the latest Overture Maps release

Installation

pip install wkls

Usage

Countries, regions, counties, and cities

Chain up to 3 levels: countryregioncounty or city.

import wkls

wkls.us.wkt()                  # United States
wkls.us.ca.wkt()               # California
wkls.us.ca.sanfrancisco.wkt()  # San Francisco

Countries and dependencies use ISO 3166-1 alpha-2 codes. Regions use the code suffix from Overture (e.g. ca for US-CA). Counties and cities match by name against the Overture dataset.

Geometry formats

wkls.de.wkt()      # Well-Known Text string
wkls.de.wkb()      # Well-Known Binary bytes
wkls.de.geojson()  # GeoJSON string

Exploring the dataset

wkls.countries()       # all countries
wkls.dependencies()    # all dependencies
wkls.us.regions()      # regions in the US
wkls.us.ca.counties()  # counties in California
wkls.us.ca.cities()    # cities in California
wkls.fk.cities()       # countries without regions work too

Wildcard search

Use % for pattern matching when you're not sure of the exact name:

wkls.us.ca["%francis%"]  # matches "San Francisco"

Pinning an Overture version

wkls auto-detects the latest Overture Maps release. To pin a specific version:

wkls.configure(overture_version="2025-12-17.0")

wkls.overture_version()   # current version
wkls.overture_releases()  # available versions

Or set the WKLS_OVERTURE_VERSION environment variable:

export WKLS_OVERTURE_VERSION=2025-12-17.0

Priority: configure() > environment variable > auto-detect.

Bracket access

Some names collide with Python keywords or DataFrame methods. Use bracket syntax when attribute access doesn't work:

wkls["us"]["ne"].wkt()  # Nebraska (wkls.us.ne would call DataFrame.ne)
wkls["at"]["1"].regions()  # Austria's region "1"

You can mix attribute and bracket access freely.

How it works

wkls resolves locations in two stages:

  1. Metadata resolution — your chained attributes are matched against a bundled metadata table (country by ISO code, region by code suffix, county or city by name). No geometry is loaded at this stage.

  2. Geometry fetch — when you call .wkt(), .wkb(), or .geojson(), the geometry is fetched from Overture Maps GeoParquet on S3 via Apache SedonaDB.

Contributing

We welcome contributions! Please see our Contributing Guide for details on how to get started, development setup, and submission guidelines.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details. wkls includes, references, and leverages data from the "Divisions" theme of Overture, from Overture Maps Foundation:

Acknowledgments

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

wkls-1.1.0.tar.gz (16.4 MB view details)

Uploaded Source

Built Distribution

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

wkls-1.1.0-py3-none-any.whl (16.4 MB view details)

Uploaded Python 3

File details

Details for the file wkls-1.1.0.tar.gz.

File metadata

  • Download URL: wkls-1.1.0.tar.gz
  • Upload date:
  • Size: 16.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wkls-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7bcc829c688864db4c5a184bf12acacc3af0ed2706d60120642754c1664a8ccf
MD5 1d99a3ba566fc929cdd1d47bc66b45bd
BLAKE2b-256 42be1100a89ecd979a11e24280d562bd2d42acc8149df9a825036af202bf2d56

See more details on using hashes here.

Provenance

The following attestation bundles were made for wkls-1.1.0.tar.gz:

Publisher: pypi-publish.yaml on wherobots/wkls

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

File details

Details for the file wkls-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: wkls-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wkls-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 598ac7f8b9464c0d1dbdb5d250a224b07f675e0c8c5c8e35af13c2715520d815
MD5 9865ec0e4a912f1427a40de1663d2f01
BLAKE2b-256 1021870ccc8e3819c3a371dba041197e3e09dd7df9e60f490a6a621fde225887

See more details on using hashes here.

Provenance

The following attestation bundles were made for wkls-1.1.0-py3-none-any.whl:

Publisher: pypi-publish.yaml on wherobots/wkls

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