Skip to main content

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: country → region → county 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

Metadata

Release files for wkls 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wkls 1.0.0
File Size Uploaded Provenance
wkls-1.0.0.tar.gz 16.4 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for wkls 1.0.0
File Interpreter ABI Platform
wkls-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.8 MB

Release files / wkls-1.0.0.tar.gz

Download URL wkls-1.0.0.tar.gz
Size 16.4 MB
Tags Source
SHA-256 checksum
How to use checksums
36fceb26513c7ec2238bd28b4e209116f9d5e70d219ef38a4cea1d59ee4691ca
BLAKE2b-256 checksum
How to use checksums
5d681342756e58fd0c2a09d4b7412de49d15307e57409745209c20b302984fac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.

Transparency log

Release files / wkls-1.0.0-py3-none-any.whl

Download URL wkls-1.0.0-py3-none-any.whl
Size 16.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
233d03d38b1b08b0271480f5a51dc970641771ff90fd0c576695af1edb18c475
BLAKE2b-256 checksum
How to use checksums
ac32eb2d778a2800af8bd2dcdba2ed91ea4abc28598488f6cbad94948646bd76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.

Transparency log

Security for wkls 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wkls-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page