Skip to main content

Tests Python Original code license Contributions

Azimlib

Independent cartography in Python, with a familiar plotting API.

Build maps from geographic data, compose scientific figures, and explore them in an interactive viewer. Azimlib owns its geometry, projections, coordinate transformations, map layers, layout and rendering. Matplotlib and other GIS engines are not runtime dependencies.

Getting started · API reference · Examples · Compatibility

Maps rendered by Azimlib: Brazil, a thematic map, an orthographic globe and synthetic terrain

The examples above use Azimlib's own renderer. Boundaries and rivers are from Natural Earth; thematic values, terrain and vectors are synthetic. See the reproducible showcase.

Install

Requires Python 3.10 or newer. Version 0.2.0 is being prepared for its first PyPI publication. Once available, choose the output you need:

python -m pip install azimlib           # SVG and portable HTML; no dependencies
python -m pip install "azimlib[png]"    # PNG export
python -m pip install "azimlib[gui]"    # Interactive desktop viewer + PNG

Until the PyPI release is available, install directly from the source:

git clone https://github.com/Kernerian/azimlib.git
cd azimlib
python -m pip install ".[gui]"

The desktop viewer requires Tk, normally included with official Windows and macOS Python installations; on Linux it may need an operating-system package. Pillow, aggdraw and NumPy provide low-level raster support. Optional azimlib[accelerate] uses NumPy/Numba to compile Azimlib's own coverage kernel. No external cartography library is required for any of these installations.

Your first map

Both import styles expose the familiar figure/axes workflow:

import azimlib as azl
# Or: import azimlib.pyplot as plt

fig, ax = azl.subplots(figsize=(8, 9), projection="mercator")
ax.map("brazil", facecolor="white", edgecolor="black", linewidth=0.8)
ax.states(edgecolor="#777777", linewidth=0.4)
ax.rivers(color="#237f96", linewidth=0.8, label="Rivers")
ax.scatter(
    lon=[-46.63, -43.17], lat=[-23.55, -22.90],
    s=[40, 60], c="#c34968", label="Cities",
)
ax.set_title("Brazil")
ax.set_xlabel("Longitude")
ax.set_ylabel("Latitude")
ax.legend()
ax.scale_bar()
ax.north_arrow()

fig.savefig("brazil.svg")        # Static export; no viewer controls
fig.savefig("brazil.png", dpi=200)
azl.show()                       # Interactive desktop viewer

Longitude and latitude are geographic coordinates. Use subplot_kw={"projection": "mercator"} if you prefer the Matplotlib-style subplot configuration. A GeoJSON path, dictionary or feature collection can be added with ax.geojson(data).

savefig() writes a static PNG or SVG. show() opens the independent desktop canvas with Home, Back, Forward, Pan, Zoom, Subplots, Save and cursor coordinates. A separate portable HTML viewer is available with fig.show(backend="browser", path="map.html"); it navigates an exported scene, without a live Python connection.

Add only the components you need

Grid, legend, colorbar, scale bar, north arrow, compass and overview map are optional. There is no default minimap or grid. North arrow and compass are separate components, and a legend has a title only when you provide one.

ax.grid(linestyle="--", linewidth=0.5)
scale = ax.scale_bar()
scale.set_visible(False)
scale.set_visible(True)
ax.compass()
ax.overview(context="brazil")
fig.canvas.draw_idle()

Artists expose editing, visibility and removal controls. You can set limits, change styles, edit labels and update scalar data while retaining the same figure. See components and Artist editing.

Thematic and scientific maps

import azimlib.pyplot as plt
from azimlib import datasets

data = datasets.load("states", country="brazil")
values = list(range(len(data["features"])))  # Synthetic example values

fig, ax = plt.subplots(projection="mercator")
layer = ax.choropleth(data, values, cmap="viridis", bins=None)
bar = fig.colorbar(layer, ax=ax, orientation="horizontal", label="Example value")
ax.set_title("Values by state")
layer.set_clim(0, 30)
bar.set_label("Updated example value")
fig.savefig("thematic.svg")
Build With
Political and regional maps Countries, states, boundaries, ax.state("SP")
Physical and hydrographic maps Coastlines, rivers, lakes, geographic labels
Choropleths and categories Feature styles, colormaps, norms, editable colorbars
Points and proportional bubbles Scatter, markers, symbols, values mapped to size/color
Routes and vector fields Styled lines, arrows, spherical routes, quiver
Density and scalar fields Heatmaps, raster fields, isolines, hillshade
Atlases and regional focus Subplots, GridSpec, mosaics, shared axes, insets/overviews

Lines support widths, opacity, dashes, caps, joins and arrows; polygons support per-feature styling and hatches. Text offers alignment, rotation, backgrounds and halos. Layout includes tight/constrained modes, physical sizing and editable ticks. Colorbars support horizontal/vertical placement, ticks, labels and norms.

The spherical projection implementations include equirectangular, Mercator, orthographic, Lambert conformal conic, Albers equal area and Equal Earth. An orthographic globe is a 2D projection, not a 3D terrain engine.

Learn more

Azimlib 0.2.0 is an early independent cartography library, not a complete replacement for every Matplotlib API. Read the compatibility boundaries before migrating. Detailed views can still require expensive rasterization. Urban data workflows, more file formats, 3D and temporal visualization are future work. Automated CI covers Windows, Linux and macOS; native human visual acceptance currently covers Windows.

Contribute and get help

Report bugs or ask questions through GitHub Issues. Include a minimal example, Python/Azimlib versions and the relevant output format. See the contribution guide for local tests, data provenance and independent implementation requirements. Please follow the code of conduct. Use the security policy for sensitive vulnerability reports.

License and provenance

Original code and visual compositions: BSD 3-Clause, copyright 2026 Kernerian. Bundled geographic data, fonts and palettes retain their own terms: Natural Earth is public domain; DejaVu fonts retain their license; Viridis, Plasma, Inferno and Magma tables are CC0; Blues retains ColorBrewer terms. The default AZIM10 color sequence is independently selected.

This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).

See LICENSE, third-party notices and branding assets. The familiar API and navigation are implemented independently; Matplotlib artwork and source code are not distributed as Azimlib's implementation.

Metadata

Release files for azimlib 0.2.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 azimlib 0.2.0
File Size Uploaded
azimlib-0.2.0.tar.gz 6.8 MB Details

Built distribution (wheel)

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

Total release size: 9.9 MB

Release files / azimlib-0.2.0.tar.gz

Download URL azimlib-0.2.0.tar.gz
Size 6.8 MB
Tags Source
SHA-256 checksum
How to use checksums
6b8862e85830a32eafacaaffe2da666510eeec458cd677193cf74d7a8303501b
BLAKE2b-256 checksum
How to use checksums
132c8f56ce12d6ccd64c8f3deaf3d69e3f6ba80531ae6790cd755138fc081b4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 6, 2026.

Transparency log

Release files / azimlib-0.2.0-py3-none-any.whl

Download URL azimlib-0.2.0-py3-none-any.whl
Size 3.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
77aff9e2c7c49de27ac71894da407228c3b932d63c1c0f09e1ed91cab4e55947
BLAKE2b-256 checksum
How to use checksums
ffa741b3273e57251b59937af7854a103b6f3e9cdea8ffe2e67eb37778891506
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release 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