Skip to content

Repository files navigation

mapflow logo

mapflow

PyPI version Conda version CI Documentation Status License

mapflow creates geographic plots and video animations directly from xarray.DataArray objects. It detects common coordinate names, understands CRS metadata, includes world borders, and streams lazily backed animation frames to keep memory use bounded.

Installation

Install the Python package from PyPI:

python -m pip install mapflow

Or from conda-forge, which also installs FFmpeg:

conda install -c conda-forge mapflow

Creating animations requires the ffmpeg executable on PATH. Static plots do not require FFmpeg.

Quick start

import xarray as xr

from mapflow import animate, plot_da

ds = xr.tutorial.open_dataset("era5-2mt-2019-03-uk.grib")
temperature = ds["t2m"]

plot_da(temperature.isel(time=0))
animate(temperature.isel(time=slice(120)), "temperature.mp4", video_width=1280)

Example mapflow plot

The documentation covers static plots, scalar animations, vector-field quiver plots, CRS handling, color normalization, and the reusable PlotModel and Animation classes.

Development

git clone https://github.com/CyrilJl/mapflow.git
cd mapflow
uv sync --group dev
uv run pytest
uv run ruff check .
uv run ruff format --check .

See CONTRIBUTING.md for the full contribution and release checks. Changes are documented in CHANGELOG.md.

License

Licensed under the Apache License 2.0.

Releases

Packages

Used by

Contributors

Languages