prettymaps README

The project's README from github.com/marceloprates/prettymaps. As one markdown file: README.md.

prettymaps

A minimal Python library to draw customized maps from OpenStreetMap created using the osmnx, matplotlib, shapely and vsketch packages.

Docs PyPI Python License

This work is licensed under a GNU Affero General Public License v3.0 (you can make commercial use, distribute and modify this project, but must disclose the source code with the license and copyright notice)

Note about crediting and NFTs:

Buy Me a Coffee at ko-fi.com

As seen on Hacker News:

prettymaps subreddit

Tutorial (marimo) · Google Colaboratory Demo

Installation

Install locally:

Install prettymaps with:

pip install prettymaps

Install on Google Colaboratory:

Install prettymaps with:

!pip install -e "git+https://github.com/marceloprates/prettymaps#egg=prettymaps"

Then restart the runtime (Runtime -> Restart Runtime) before importing prettymaps

Run front-end

After prettymaps is installed, you can run the front-end (streamlit) application from the prettymaps repository using:

streamlit run app.py

Tutorial

The full tutorial is at docs/tutorial.md — a markdown walkthrough with rendered images, the [Plot] dataclass fields, the layers/style parameters, presets, multiplot, hillshade, and keypoints.

Heerhugowaard sample

Quick start:

import prettymaps

plot = prettymaps.plot('Stad van de Zon, Heerhugowaard, Netherlands')
Resource Where to find it
Full tutorial (markdown + images) docs/tutorial.md
Interactive marimo notebook (runnable) notebooks/tutorial.py
Open in Google Colab Open in Colab
Streamlit front-end streamlit run app.py

Run the tutorial locally (marimo)

# Install marimo (already in requirements.txt)
pip install marimo

# Open the notebook in your browser
marimo edit notebooks/tutorial.py

Customizing parameters

The most important prettymaps.plot() parameters are:

plot is a dataclass with geodataframes (per-layer GeoDataFrames), fig, and ax.

plot = prettymaps.plot(
    'Praça Ferreira do Amaral, Macau',
    circle=True,
    radius=1100,
    layers={
        "water": {"tags": {"natural": ["water", "bay"]}},
        "building": {"tags": {"building": True}},
    },
    style={
        "water": {"fc": "#a1e3ff", "ec": "#2F3737"},
        "building": {"palette": ["#FFC857", "#E9724C", "#C5283D"]},
    },
)

Macau, custom parameters

See docs/tutorial.md for the full set of examples (Macau, Bom Fim, mosaic, Barcelona plotter, Tijuca, multiplot, hillshade, Garopaba keypoints).

prettymaps (marceloprates/prettymaps)

jupyter
Searching Database…

What is this?prettymaps is a Python library that draws stylized, artistic maps from OpenStreetMap data, combining osmnx, matplotlib, shapely and vsketch to render streets, buildings, water and other features as a custom-styled figure.
Is this just a library, or does it come with an app too?It is mainly a Python library you drive with prettymaps.plot(), but the repo also ships an optional Streamlit front-end (app.py) you can run locally for a GUI.
How do I install it and make my first map?Install it locally with pip, or install it on Google Colaboratory and restart the runtime, then call prettymaps.plot() with layers, style and a location; a marimo tutorial notebook and a Colab demo walk through the whole workflow.
What does it rely on under the hood?It's built on osmnx for fetching OpenStreetMap data, matplotlib for rendering, shapely for geometry, and vsketch for sketch-style drawing; you only need a Python environment.
Is there anything unusual in the license I should know about?It's AGPL-3.0, so commercial use, distribution and modification are allowed but you must disclose source code and keep the crediting message; the author also explicitly forbids using prettymaps output to mint and sell NFTs, after past misuse by other projects.
What can I customize when drawing a map?You control layers (which OSM features to fetch), style (matplotlib styling per layer), presets (JSON configs like 'default', 'minimal', 'macao', 'tijuca'), and the boundary shape via circle, radius and dilate parameters.
Where can I try it without installing anything?There's a Google Colaboratory demo notebook you can open and run directly in the browser, no local setup needed.
Can I see worked examples before diving in?docs/tutorial.md walks through rendered examples like Macau, Bom Fim, a Barcelona plotter, Tijuca, multiplot, hillshade and keypoints, with images alongside the code.
Size
557 MB
Stars
14.3K
Age
5y
Commits · 90 Days