Skip to main content
wkls is an open-source library maintained by Wherobots that provides easy, programmatic access to global administrative boundaries—countries, regions, cities, and more—using data from the Overture Maps Foundation. It comes pre-installed in WherobotsDB and is also available via pip. For the latest updates, see the wkls GitHub repository.

Installation

wkls comes pre-installed in WherobotsDB, so you do not need to install it separately if you’re using Wherobots Cloud. Just add import wkls to your notebook.
If you’re not using Wherobots Cloud, install wkls via pip:

Quick start

The WKT for the US boundary is over 3 million characters. With wkls, it’s just wkls.us.wkt().

Geometry formats

Every location exposes three output formats:

Hierarchy navigation

Use chainable dot access with ISO codes or English names:

Discovery

Explore what’s available at any level of the hierarchy: All discovery methods are scoped to the current chain position.

Countries without regions

Some countries/dependencies may not have regions. For those, call .counties() or .cities() directly:

Collection protocol

Location collections support standard Python protocols:

Arrow escape hatch

For advanced use cases, export the full Overture Maps record as a PyArrow table:

Disambiguation

When multiple locations share a name, narrow with the parent hierarchy:

Version management

wkls uses Overture Maps releases as its data source. Control which version you use:
Or set the WKLS_OVERTURE_VERSION environment variable:

Troubleshooting

The following are common issues you may encounter when using wkls, along with their causes and solutions:
Cause: An outdated wkls install in a local environment. pip install wkls can resolve to an older or cached version that points at an Overture Maps data path that no longer returns records. This does not apply in Wherobots Cloud, where wkls comes pre-installed in WherobotsDB.Solution:
  • Upgrade to the latest version: pip install --upgrade wkls.
  • Confirm the installed version with pip show wkls, then restart your Python session or notebook kernel so the new version is loaded.
  • If the error persists, reinstall without the pip cache: pip install --upgrade --no-cache-dir wkls.
Cause: wkls is available in your environment, but it has not been imported into the current session.Solution:
  • Add import wkls to your notebook or script before calling any wkls methods.

How it works

For a full explanation, see How it works in the wkls GitHub repository.

How to contribute

Contributions are welcome. See Contributing in the wkls GitHub repository.