Easy access to global administrative boundaries and geometries via Overture Maps data
Project description
wkls: Well-Known Locations
wkls makes it easy to find global administrative boundaries — from countries to cities — using readable, chainable Python syntax.
It reads Overture Maps Foundation GeoParquet data (version 2025-09-24.0) directly from the AWS Open Data Registry.
It reads directly from GeoParquet data (version 2025-09-24.0) hosted on the AWS Open Data Registry.
You can instantly get geometries in formats like Well-known Text (WKT), Well-known Binaries (WKB), HexWKB, GeoJSON, and SVG:
import wkls
# prints "MULTIPOLYGON (((-122.5279985 37.8155806...)))"
print(wkls.us.ca.sanfrancisco.wkt())
#prints "2025-09-24.0"
print(wkls.overture_version())
Installation
pip install wkls
This command also loads DuckDB with its related spatial extension.
Quick Start
After installing wkls, run the following commands to get started:
import wkls
# Get country geometry
usa_wkt = wkls.us.wkt()
print(f"USA geometry: {usa_wkt[:50]}...")
# Get state/region geometry
california_geojson = wkls.us.ca.geojson()
# Get city geometry
sf_svg = wkls.us.ca.sanfrancisco.svg()
# Check dataset version
print(f"Using Overture Maps data: {wkls.overture_version()}")
# Explore available data
print(f"Countries: {len(wkls.countries())}")
print(f"Dependencies: {len(wkls.dependencies())}")
print(f"US regions: {len(wkls.us.regions())}")
print(f"CA counties: {len(wkls.us.ca.counties())}")
Usage
Accessing geometry
wkls supports up to 3 chained attributes:
- Country/Dependencies (required) – must be a 2-letter ISO 3166-1 alpha-2 code (e.g.
us,de,fr) - Region (optional) – must be a valid region code suffix as specified by Overture (e.g.
caforUS-CA,nyforUS-NY) - Place (optional) – a name match against subtypes:
county,locality, orneighborhood
Examples:
wkls.us.wkt() # country: United States
wkls.us.ca.wkt() # region: California
wkls.us.ca.sanfrancisco.wkt() # city/county: San Francisco
wkls["us"]["ca"]["sanfrancisco"].wkt() # dictionary-style access
Supported formats
wkls supports the following formats:
.wkt()– Well-Known Text.wkb()– Raw binary WKB.hexwkb()– Hex-encoded WKB.geojson()– GeoJSON string.svg()– SVG path string
Example: Find the administrative boundary of San Francisco, California
Chained expressions like wkls.us.ca.sanfrancisco return a WKL object. Internally, this holds a Pandas DataFrame containing one or more rows that match the given chain.
id country region subtype name
0 085718963fffff... US US-CA county San Francisco
In most cases, wkls resolves to a single administrative boundary. But if there are name collisions (e.g., both a county and a locality called “San Francisco”), multiple rows may be returned.
By default, geometry methods like .wkt() will use the first matching row.
Helper methods
The following methods return Pandas DataFrames for easy exploration:
| Method | Description |
|---|---|
wkls.countries() |
List all countries |
wkls.dependencies() |
List all dependencies |
wkls.us.regions() |
List regions in the US |
wkls.us.ca.counties() |
List counties in California |
wkls.us.ca.cities() |
List cities in California |
wkls.subtypes() |
Show all distinct division subtypes |
Some countries/dependencies may not have regions, so for those
countries/dependencies you can directly call either .counties() or
.cities(), to further explore the available data.
wkls.fk.cities()
Dataset information
You can check which version of the Overture Maps dataset is being used:
print(wkls.overture_version())
> "2025-09-24.0"
Note: The
overture_version()method is only available at the root level, not on chained objects likewkls.us.overture_version().
How It Works
wkls works in two stages:
1. In-memory GERS ID resolution
Your chained attributes — up to 3 levels — are parsed in this order:
country/dependency→ matched by ISO 2-letter code (e.g."us")region→ matched using region code suffix as specified by Overture (e.g."ca"→"US-CA")place→ fuzzy-matched against names in subtypes:county,locality, orneighborhood
This resolves to a Pandas DataFrame containing one or more rows from the in-memory wkls metadata table. At this stage, no geometry is loaded yet — only metadata (like id, name, region, subtype, etc.).
2. Geometry lookup using DuckDB
The geometry lookup is triggered only when you call one of the geometry methods:
.wkt().wkb().hexwkb().geojson().svg()
At that point, wkls uses the previously resolved GERS ID to query the Overture division_area GeoParquet directly from S3.
The current Overture Maps dataset version can be checked with wkls.overture_version().
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.
Acknowledgments
- Overture Maps Foundation for providing high-quality, open geospatial data.
- DuckDB for fast analytical queries with spatial support.
- AWS Open Data Registry for hosting the dataset.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wkls-0.4.5.tar.gz.
File metadata
- Download URL: wkls-0.4.5.tar.gz
- Upload date:
- Size: 17.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdf15fc73cf58858545193e8c33439ef33a21877e958b56a2b4d99489f101f9c
|
|
| MD5 |
9db128b7ecd7804223f86009ee0a56f5
|
|
| BLAKE2b-256 |
7f0a9e9d63bc83d624bd8ce897eb4a10c5776739f6a318f979d06cf3504497ae
|
Provenance
The following attestation bundles were made for wkls-0.4.5.tar.gz:
Publisher:
pypi-publish.yaml on wherobots/wkls
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wkls-0.4.5.tar.gz -
Subject digest:
bdf15fc73cf58858545193e8c33439ef33a21877e958b56a2b4d99489f101f9c - Sigstore transparency entry: 675019425
- Sigstore integration time:
-
Permalink:
wherobots/wkls@b6298b143bb4e1a2a06c3de932328a8e6d4598fd -
Branch / Tag:
refs/tags/v0.4.5 - Owner: https://github.com/wherobots
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@b6298b143bb4e1a2a06c3de932328a8e6d4598fd -
Trigger Event:
push
-
Statement type:
File details
Details for the file wkls-0.4.5-py3-none-any.whl.
File metadata
- Download URL: wkls-0.4.5-py3-none-any.whl
- Upload date:
- Size: 17.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2a7b143b7b5f035783c48f8efdf97eebcb35e60f1e2bb12939bf6baf3679fee
|
|
| MD5 |
f2c430b9be54bba58eaf6779ed1d7343
|
|
| BLAKE2b-256 |
7686a04f6804cd28f58f41386c9aa0e370998cd63b457b6d3ef00f996f4f3395
|
Provenance
The following attestation bundles were made for wkls-0.4.5-py3-none-any.whl:
Publisher:
pypi-publish.yaml on wherobots/wkls
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wkls-0.4.5-py3-none-any.whl -
Subject digest:
c2a7b143b7b5f035783c48f8efdf97eebcb35e60f1e2bb12939bf6baf3679fee - Sigstore transparency entry: 675019448
- Sigstore integration time:
-
Permalink:
wherobots/wkls@b6298b143bb4e1a2a06c3de932328a8e6d4598fd -
Branch / Tag:
refs/tags/v0.4.5 - Owner: https://github.com/wherobots
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@b6298b143bb4e1a2a06c3de932328a8e6d4598fd -
Trigger Event:
push
-
Statement type: