Draw beautiful maps from OpenStreetMap with a simple Python API and CLI.
Project description
Umap v3.0
A powerful Python library for creating beautiful, customized maps from OpenStreetMap data. Now with simplified CLI, automatic caching, and smart optimization!
Minimal style map of Yalova created with CLI
🚀 Key Features
- 🔧 Super Simple CLI: Just type
umap Istanbuland get your map on desktop! - 🖥️ Desktop Output: Maps automatically saved to your desktop
- 💾 Automatic Caching: Speeds up repeated map generation for the same area
- ⚡ Auto Optimization: Intelligently adjusts map details based on the requested radius
- 🎨 Enhanced Styles: Includes
minimal,blueprint, andvintagestyles out-of-the-box - 🔄 Batch Processing: Generate multiple maps from a list of locations
- 🐍 Python API: Full programmatic control for advanced customization
Umap v3 Highlights
- ✨ Streamlined CLI: No complex subcommands - just
umap <city>and done! - 📦 PyPI Packaging: Easy installation and direct command access
- 🔖 Version Constant: Access the library version with
umap.__version__ - 🔇 Clean Output: No verbose logging, just clear progress messages
Installation
# Install from PyPI
pip install umap-osm
# For developers
git clone https://github.com/U-C4N/Umap.git
cd Umap
pip install -e .
🔧 CLI Quick Start
Super simple - just name your location:
# After pip install, use direct commands
umap Istanbul
umap "New York"
umap London
# Or without pip install
python umap Istanbul
python umap Ankara
python umap "Los Angeles"
# With coordinates
umap --coords "40.66,29.28"
# Custom options
umap Istanbul --style vintage --radius 10000
Blueprint style map of Yalova created with CLI
CLI Options
umap --help # See all options
umap Istanbul --style blueprint --radius 8000
umap "New York" --output "/path/to/my/map.png"
umap --coords "40.66,29.28" --style vintage
All maps are automatically saved to your Desktop unless you specify --output
🔧 Troubleshooting
If umap command is not found after installation:
Windows:
# Use Python module approach
python -m umap Istanbul
# Or add Python Scripts to PATH:
# Add C:\Users\YourUser\AppData\Roaming\Python\Python3xx\Scripts to PATH
macOS/Linux:
# Use Python module approach
python -m umap Istanbul
# Or check PATH includes pip install location
pip show -v umap-osm
📚 Python API Example
import umap
# Create and save a map
plot = umap.plot(
(40.66, 29.28), # Yalova coordinates
radius=5000,
style='vintage' # Use a predefined style name or a custom style dict
)
if plot.fig:
umap.add_frame(plot.ax) # Optional: Add a frame
plot.fig.savefig('yalova_api_vintage.png', dpi=300, bbox_inches='tight')
Vintage style map of Yalova created with Python API
🎨 Styles
Umap comes with several built-in styles:
minimal: Clean black & white.blueprint: Technical drawing look.vintage: Retro, old-map feel.
You can also define your own custom styles. See umap/cli.py for examples of style dictionaries.
💾 Caching & Optimization
- Caching: Data downloaded from OpenStreetMap is automatically cached in
~/.umap_cacheto speed up subsequent runs for the same area. - Optimization: Map details (like road types shown or minimum building size) are automatically adjusted based on the map's radius for better performance and visual clarity.
🧪 Examples & Testing
Check the examples/ directory:
yalova_styles.py: Generates maps of Yalova in all predefined styles.yalova_performance.py: Benchmarks map generation for different radii.
Run them from the project root:
python examples/yalova_styles.py
python examples/yalova_performance.py
🔧 Development
Key modules:
umap/core/plot.py: Core plotting logic.umap/core/fetch.py: Data fetching from OSM.umap/cli.py: Command Line Interface.umap/utils/cache.py: Caching mechanism.umap/utils/optimization.py: Performance and detail optimization.
License
MIT License
Author
Umap v3.0 - Making beautiful maps easier than ever! 🗺️
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file umap_osm-3.0.0.tar.gz.
File metadata
- Download URL: umap_osm-3.0.0.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a3557496c4f4dfd87b5f9a6e6fdb3f59bed83af5dfd16351d7c92ea5e5bab99
|
|
| MD5 |
9ae33e573a83b502f268113f5b9c878d
|
|
| BLAKE2b-256 |
6357325daa651fb618b511b5252ac1ce6d3f0270615c82ba370f720e1f8be28c
|
File details
Details for the file umap_osm-3.0.0-py3-none-any.whl.
File metadata
- Download URL: umap_osm-3.0.0-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a4d3ff78fdf859de060ca83b00237bc4c92c6821a1b3b9b0362de34a163f00e
|
|
| MD5 |
22815cd8dd60247a14d5463cb3751e65
|
|
| BLAKE2b-256 |
63a9ae5358686cc6595a19f8f8cbeb7b48771dbc5037989ba82519f91625908e
|