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
  • Currently, wkls outputs boundaries in WKT or WKB
  • Support for GeoJSON, 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

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() or .wkb(), 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.0.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.0.0-py3-none-any.whl (16.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wkls-1.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 36fceb26513c7ec2238bd28b4e209116f9d5e70d219ef38a4cea1d59ee4691ca
MD5 a221e5e5f63a1f969b44acd6802b7dc2
BLAKE2b-256 5d681342756e58fd0c2a09d4b7412de49d15307e57409745209c20b302984fac

See more details on using hashes here.

Provenance

The following attestation bundles were made for wkls-1.0.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.0.0-py3-none-any.whl.

File metadata

  • Download URL: wkls-1.0.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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 233d03d38b1b08b0271480f5a51dc970641771ff90fd0c576695af1edb18c475
MD5 f01bfdcd8b9825e5662d66eec58df2c0
BLAKE2b-256 ac32eb2d778a2800af8bd2dcdba2ed91ea4abc28598488f6cbad94948646bd76

See more details on using hashes here.

Provenance

The following attestation bundles were made for wkls-1.0.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