explaingit

marceloprates/prettymaps

12,258Jupyter NotebookAudience · designerComplexity · 2/5LicenseSetup · easy

TLDR

Prettymaps is a Python library that generates stylized artistic map illustrations of any real-world location using OpenStreetMap data in a single line of code.

Mindmap

mindmap
  root((prettymaps))
    What it does
      Stylized map images
      One-line API
      Named presets
    Inputs
      City name
      Address
      Coordinates
    Tech Stack
      Python
      OpenStreetMap
      Streamlit
    Use Cases
      Map art posters
      Social media visuals
      No-code browser tool
    Audience
      Designers
      Vibe coders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Generate custom stylized map art of any city or address for posters or social media.

USE CASE 2

Switch between named city presets to reproduce different visual map styles instantly.

USE CASE 3

Launch the built-in Streamlit web interface to generate maps in a browser without writing code.

Tech stack

PythonOpenStreetMapStreamlit

Getting it running

Difficulty · easy Time to first run · 5min

OpenStreetMap credit text printed on each image must be kept intact as required by the data license.

Use freely including commercially, but any modifications must be released as open source under the same AGPL v3 license.

In plain English

Prettymaps is a Python library that turns real map data into stylized, visually appealing images. You give it a location, such as a city name, a street address, or a pair of latitude and longitude coordinates, and it fetches the actual geographic data from OpenStreetMap (a free, community-maintained world map) and then draws a custom illustration of that area. The results show streets, buildings, water, parks, and other features rendered in a graphic style rather than a standard navigation map look. Using it requires only a single line of code: prettymaps.plot('your location here'). The library handles downloading the data and producing the image automatically. It also comes with named "presets," which are saved style configurations, so you can switch between different color schemes and visual styles without adjusting individual settings. A preset called "minimal" produces a simpler look, while other presets named after specific cities (barcelona, macao, tijuca) reproduce the styling seen in example images from those places. Beyond a one-line Python call, the library also ships with a web front-end built on a tool called Streamlit. Running that gives you a browser-based interface for generating maps without writing code. There is also a demo available on Google Colaboratory, which lets you try it in a browser without installing anything locally. The project uses OpenStreetMap data, so the author asks that the credit text printed on each output image be kept intact, as this is required by OpenStreetMap's own license. The library is released under the AGPL v3 license, which allows commercial use and modifications but requires that any modifications also be shared as open source. The README includes an explicit note that the author does not authorize use of this project to generate NFTs, though they acknowledge they cannot legally enforce that restriction.

Copy-paste prompts

Prompt 1
Using prettymaps, generate a styled map of Tokyo in the minimal preset and save it as a PNG file.
Prompt 2
How do I create a custom color preset in prettymaps for a dark-mode city map style?
Prompt 3
Write a Python script that takes a list of city names and saves a prettymaps illustration for each one.
Prompt 4
Set up the prettymaps Streamlit interface locally so I can generate maps through a browser.
Open on GitHub → Explain another repo

← marceloprates on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.