Skip to content

Repository files navigation

Mapyta

One import. A few method calls. A full interactive map.

PyPI version Supported Python versions Tests Documentation License: MIT


Documentation: https://egarciamendez.github.io/mapyta

Source Code: https://github.com/egarciamendez/mapyta


Build OpenStreetMap visualizations with hover tooltips, choropleths, heatmaps, and export to HTML or PNG all from Shapely geometries.

Perfect for geotechnical site plans, infrastructure overviews, or any spatial data visualization where you want more control than static images but don't need the full power of a GIS.

Mapyta is standing on the shoulders of giants like Folium and Leaflet, but it's designed to be more intuitive and Pythonic for users who are already familiar with Shapely and GeoPandas. It's not trying to replace a full GIS, but rather to provide a simple way to create interactive maps without needing to learn a whole new set of tools.

A mapyta map of Amsterdam with markers, areas, and a walking route

👉 See the Showcase — every feature as a live, interactive map on a single page.


Key features


Installation

Mapyta requires Python 3.12+.

uv add mapyta
# or
pip install mapyta

Exporting maps to PNG/SVG images additionally needs a headless browser (Chrome, Chromium, or Edge) and the export extra:

uv add "mapyta[export]"
# or
pip install "mapyta[export]"

Quickstart

Create your first map:

from shapely.geometry import Point
from mapyta import Map

m = Map(title="Hello Utrecht")
m.add_point(
    point=Point(5.121311, 52.090648),
    tooltip="**Utrecht**",
    popup="**Utrecht**\nCity in the Netherlands\nPopulation: ~350k",
    caption="UTR",
)
m.to_html("hello.html")

Open hello.html in any browser and you're done.

Want the map as an image instead? Get raw PNG bytes or a buffer, no file needed:

png_bytes = m.to_image()   # bytes, for an HTTP response or an email attachment
buf = m.to_bytesio()       # io.BytesIO, e.g. for Flask/FastAPI/Django

See the Showcase for choropleths, heatmaps, clusters, drawing tools, and more — each as a live, interactive map — or work through the Tutorial one concept at a time.

Contributing

Issues and pull requests are welcome. To set up a local development environment:

git clone https://github.com/egarciamendez/mapyta
cd mapyta
uv sync --all-extras --all-groups
uv run pytest

Please open an issue to discuss substantial changes before starting.

License

This project is licensed under the terms of the MIT license.

About

One import. A few method calls. A full interactive map.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages