Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

GeoMapLib

GeoMapLib is a small, opinionated Python library for creating trustworthy and attractive geographic visualizations from Pandas and GeoPandas data.

The project is deliberately narrower than a GIS framework. GeoPandas remains the geometry engine; GeoMapLib focuses on the repetitive visualization layer: geography resolution, safe attribute joins, sensible map defaults, missing-data handling, and Matplotlib rendering.

Installation

python -m pip install geomaplib

GeoMapLib requires Python 3.12 or newer.

Quick start

The first release focuses on one job: static continuous polygon choropleths. The built-in world geography works offline and uses ISO 3166-1 alpha-3 country identifiers.

import geomaplib as gm
import pandas as pd

df = pd.DataFrame(
    {
        "iso_code": ["USA", "NGA", "TUR"],
        "value": [10.0, 25.0, 18.0],
    }
)
ax = gm.choropleth(
    data=df,
    geography="world",
    locations="iso_code",
    color="value",
)

The result is a static Matplotlib world map with the three matched countries shaded on a continuous color scale and all other polygons shown with the missing-data style. Input ISO values are stripped and uppercased; country-name matching is not performed. See the world dataset documentation for source provenance, boundary conventions, and known coverage limitations.

Custom polygon geographies can be supplied as a GeoDataFrame:

ax = gm.choropleth(
    data=df,
    geography=regions_gdf,
    feature_key="region_id",
    locations="region_id",
    color="value",
)

An existing local geography file works the same way by passing its path as geography="regions.geojson". If a GeoDataFrame already contains both its geometry and values, use gm.choropleth(data=regions_with_values, color="value") without join arguments.

choropleth() returns the exact Matplotlib Axes used for rendering, so it composes with normal Matplotlib operations:

import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(10, 6))
returned = gm.choropleth(
    data=df,
    geography="world",
    locations="iso_code",
    color="value",
    ax=ax,
)
assert returned is ax
ax.set_title("Example")
fig.savefig("map.png")

Design principles

  • Functional, DataFrame-first public API.
  • Composition over inheritance.
  • Matplotlib-native rendering and styling.
  • No global plotting-style mutation.
  • Exact custom-geography joins; no fuzzy matching.
  • ISO alpha-3 normalization only for the built-in country geography.
  • Duplicate locations never aggregate silently.
  • GeoPandas and Matplotlib remain available as escape hatches.
  • New abstractions are added only when new requirements justify them.

Development setup

python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
python -m pip install -e ".[dev]"

Quality checks

pytest --cov=geomaplib --cov-report=term-missing
ruff check .
ruff format --check .
mypy src/geomaplib
python -m build

Documentation

v0.1 non-goals

Categorical choropleths, classification schemes, projections, point/bubble maps, labels, density maps, remote geography downloads, interactive backends, fuzzy country matching, and public Map/Layer builders are intentionally deferred. See the roadmap for the planned evolution.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geomaplib-0.1.0rc1.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

geomaplib-0.1.0rc1-py3-none-any.whl (988.7 kB view details)

Uploaded Python 3

File details

Details for the file geomaplib-0.1.0rc1.tar.gz.

File metadata

  • Download URL: geomaplib-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for geomaplib-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 b4c79a81469099b30fce6d5abdc18899083dcd46155640c3c2dfb7f4a97738a2
MD5 1e25fd1799693a5b8d35f7b98debb3a8
BLAKE2b-256 dfa1c7031084552be91c105b02e17ed74382ab3af8b5fe620af795eb11d78f3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for geomaplib-0.1.0rc1.tar.gz:

Publisher: release.yml on anyx05/geomaplib

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

File details

Details for the file geomaplib-0.1.0rc1-py3-none-any.whl.

File metadata

  • Download URL: geomaplib-0.1.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 988.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for geomaplib-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 1761a7993d89affcb0a5afc713ee6d155587ba0f68b65a9e47226b3c099235c9
MD5 383f80753b6cffeed15b9a9121c4b290
BLAKE2b-256 0ff6b78b76c890d0a47f5dc856662bad9246668655ee54a16cb12e1b41713e66

See more details on using hashes here.

Provenance

The following attestation bundles were made for geomaplib-0.1.0rc1-py3-none-any.whl:

Publisher: release.yml on anyx05/geomaplib

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

Release history Release notifications | RSS feed

This release

0.1.0rc1 This release

2 files

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