Skip to main content

mapstyle

mapstyle

A whole OpenStreetMap map in one offline HTML page:
the roads for driving, walking and cycling over a full base map, from one duckOSM database.

CI Docs Python 3.10+ License MIT

Documentation · Live map · Get started · Gallery · JavaScript API


Monaco drawn by mapstyle: streets, paths, buildings, parks, the port and the sea

Quick start

pip install "duckosm @ git+https://github.com/Khoshkhah/duckOSM" \
            "mapstyle @ git+https://github.com/Khoshkhah/mapstyle"

curl -LO https://download.geofabrik.de/europe/monaco-latest.osm.pbf
duckosm build --pbf monaco-latest.osm.pbf -o monaco.duckdb \
              -m driving -m walking -m cycling
mapstyle monaco.duckdb          # -> monaco_all.html: one file, opens offline
import mapstyle as ms

ms.render_map("monaco.duckdb").save("monaco.html")                    # the whole map
ms.render_map("monaco.duckdb", mode="walking", paths="komoot")        # paths in front
ms.render_map("monaco.duckdb", planner=True).save("planner.html")     # + a route planner
ms.render_map("monaco.duckdb", dashboard=True).save("dashboard.html") # a dashboard

What you get

  • Every travel mode on one map, or one brought to the front: all, driving, walking, cycling; and four looks for paths (google, osm, komoot, cyclosm).
  • A full base map from the same database: the sea, land use with openstreetmap.org's textures, water, buildings, railways, parking, transit, traffic lights and crossings. No tile server, no API key.
  • Roads drawn right at junctions: two-way roads as two lanes, bridges over, tunnels under only where they really pass under a road, raised walkways, crossings over their street.
  • A route planner in the page: drive, walk, cycle or walk + drive, fastest or shortest, with turn-by-turn directions.
  • A dashboard: filter by mode, road class and layer, colour by mode, inspect what you click.
  • A JavaScript API: every page is a roadstyle page (rsQuery, rsFilter, rsColor, …) plus rsSetModes, rsSetKinds and rsSetInteraction; 3D, Street View and vector tiles for large areas come with it.
The walking mode
Walking: paths in front
A raised walkway over a roundabout
A raised walkway over a roundabout
The route planner
The route planner
The dashboard
The dashboard

How it fits together

Project Its part
duckOSM OpenStreetMap → one DuckDB file: the driving, walking and cycling networks and the base-map layers
mapstyle reads that file (with duckdb only) and styles all of it as one map
roadstyle draws the page: MapLibre GL, the road styling, the JavaScript API

The look is data: four YAML files in src/mapstyle/styles/ (travel modes, path styles, colours, layers). See Styles.

Command line

mapstyle DB [-o OUT] [--mode {all,driving,walking,cycling}] [--paths {google,osm,komoot,cyclosm}]
            [--no-layers] [--planner] [--dashboard] [--tiles] [--basemap BASEMAP]

For AI agents

  • Using mapstyle: the agent skill skills/mapstyle/SKILL.md has the install, the one call, the options, the JavaScript API and the traps in one page. In Claude Code: /plugin marketplace add Khoshkhah/mapstyle, then /plugin install mapstyle@mapstyle.
  • The docs as text: llms.txt and llms-full.txt (every page, one file).
  • Changing mapstyle: AGENTS.md has the commands and the project's rules.

More: AI agents.

Development

git clone https://github.com/Khoshkhah/mapstyle && cd mapstyle
python -m venv .venv && .venv/bin/pip install -e ".[dev,tiles]"
.venv/bin/pytest          # builds a Monaco database with a duckOSM checkout next to this one

Tests look for duckOSM in ../duckOSM (with its .venv), or wherever DUCKOSM_DIR / DUCKOSM_EXE point; MAPSTYLE_TEST_DB reuses a database you already built. Design notes are in docs/design/.

License

MIT. Map data © OpenStreetMap contributors (ODbL); the sea from Overture Maps, built from OpenStreetMap's coastline.

Metadata

Release files for mapstyle 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mapstyle 0.1.0
File Size Uploaded
mapstyle-0.1.0.tar.gz 45.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mapstyle 0.1.0
File Interpreter ABI Platform
mapstyle-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 88.1 kB

Release files / mapstyle-0.1.0.tar.gz

Download URL mapstyle-0.1.0.tar.gz
Size 45.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ebffbd2ee6f56f836ba77cb3839d38825baa8fe93f1b0619c5cf2381450f184f
BLAKE2b-256 checksum
How to use checksums
e45aa56b0262e868d7c2079f675d5d46fd130ea255b1e7e747ba416b429903f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / mapstyle-0.1.0-py3-none-any.whl

Download URL mapstyle-0.1.0-py3-none-any.whl
Size 42.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ba06dd22bd0a1a9613ab7988ce2744791e051526ed65591e20789e0e796263c
BLAKE2b-256 checksum
How to use checksums
319725a5472814712dba21844c25bfb00886dd13f7db091f10d8ae638dcc9c4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page