prettymaps: Create Stunning Custom Maps from OpenStreetMap

Discover prettymaps, the Python library that transforms OpenStreetMap data into beautiful, customizable maps. With just one line of code - prettymaps.plot('your_location') - generate artistic maps featuring buildings, streets, water bodies, forests, and more. Choose from 10+ presets or create your own with full control over layers and styling. Perfect for data visualization, generative art, and cartography enthusiasts. Featured on Hacker News with 12k+ GitHub stars.

prettymaps: Transform OpenStreetMap Data into Beautiful Custom Maps

One-Line Map Magic

Creating stunning maps has never been easier. With prettymaps, you can generate publication-ready maps with a single line of code:

import prettymaps
prettymaps.plot('Stad van de Zon, Heerhugowaard, Netherlands')

That's it! The library automatically fetches OpenStreetMap data and renders beautiful maps featuring streets, buildings, water bodies, forests, and more.

Key Features

  • 10+ Built-in Presets: From minimalist to detailed artistic styles
  • Full Customization: Control layers, colors, widths, and styling
  • Multiple Input Types: Addresses, coordinates, or custom GeoDataFrames
  • Plotter Mode: Export SVG files for pen plotters
  • Multiplot Support: Combine multiple regions on one canvas
  • Hillshade & Keypoints: Advanced terrain and landmark visualization

Quick Installation

pip install prettymaps

Or use Google Colab:

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

Popular Presets

# List all available presets
prettymaps.presets()

# Use a specific preset
prettymaps.plot('Porto Alegre', preset='minimal')

Available presets: default, minimal, macao, tijuca, barcelona, heerhugowaard, and more.

Advanced Customization

prettymaps.plot(
    'Praça Ferreira do Amaral, Macau',
    circle=True,
    radius=1100,
    layers={
        'building': {'tags': {'building': True}},
        'water': {'tags': {'natural': ['water', 'bay']}},
        'green': {'tags': {'landuse': 'grass', 'leisure': 'park'}},
    },
    style={
        'background': {'fc': '#F2F4CB'},
        'building': {'palette': ['#FFC857', '#E9724C', '#C5283D']}
    }
)

Real-World Applications

  1. Urban Planning: Visualize neighborhood layouts and infrastructure
  2. Generative Art: Create unique map-based artwork
  3. Data Analysis: Overlay custom data on geospatial context
  4. Presentations: Professional maps for reports and publications
  5. Plotter Art: Export for CNC pen plotters

Access Raw GeoDataFrames

plot = prettymaps.plot('Porto Alegre', show=False)
buildings = plot.geodataframes['building']
# Analyze 2,400+ building footprints with full OSM attributes

Why prettymaps Stands Out

  • 12.2K GitHub Stars - Proven community adoption
  • Hacker News Featured - Industry recognition
  • AGPL-3.0 License - Commercial use allowed with source disclosure
  • Streamlit Frontend - Interactive web interface
  • Active Development - Regular updates and new features

Get Started Today

Install prettymaps and start creating beautiful maps in minutes. Whether you're a data scientist, cartographer, or generative artist, prettymaps delivers professional results with minimal code.

Live Demo: Google Colab

Note: Always credit OpenStreetMap and the prettymaps repository per license requirements.