Skip to main content

roadstyle — opinionated road cartography and interactive map styling for Python

PyPI Tests Docs License: MIT

Turn a GeoDataFrame of road edges into one styled, interactive, offline HTML map, with real road cartography (casing and fill, per-zoom widths, street names, one-way arrows, tunnels and bridges, optional 3D) and a JavaScript API for your own dashboard. Every map has a Street View button: click any road to see it in Google Street View, looking the way it runs.

A roadstyle map of Södermalm, Stockholm: Hornsgatan selected on the map, and the floating Street View window showing it

Install

pip install roadstyle              # core
pip install "roadstyle[all]"       # + studio, numeric ramps, vector tiles, lonboard, DuckDB, …

Python ≥ 3.10. Individual extras and the dev setup: Install.

Quickstart

import geopandas as gpd
import roadstyle as rs

edges = gpd.read_file("edges.gpkg")        # LineStrings + a `highway` column, any CRS
rs.render_edges(edges).save("map.html")    # open map.html, no server needed
rs.render_edges(edges, basemap="dark_matter", view_3d=True)            # dark, 3D bridge decks
rs.render_edges(edges, palette="carto", basemap="positron")            # the classic OSM look
rs.render_edges(edges, color_by="aadt", cmap="viridis")                # colour by your data
rs.render_edges(edges, palette="mono", color_options={                 # several colourings,
    "Traffic": {"color_by": "aadt", "cmap": "viridis"},                #   switched in the browser
    "Speed":   {"color_by": "maxspeed_kmh", "cmap": "magma"}})
rs.render_edges(edges, tiles=True)                                     # 100k+ edges
rs.render_dashboard(edges).save("dashboard.html")                      # map + query sidebar
rs.render_street_view(edges).save("street_view.html")                  # map and Street View side by side

No Python? roadstyle edges.gpkg -o map.html --basemap dark_matter, or click through it in the workbench: pip install "roadstyle[studio]" && roadstyle studio.

What goes in

Only geometry and highway are required. Other columns switch features on:

Column Powers
geometry (LineString, any CRS) the edges. Each edge is directed: a two-way road is two edges with reversed geometry
highway (OSM class) colour, width, casing, draw order
name street labels, popup title
oneway direction arrows
bridge / tunnel / layer grade separation: tunnels below, bridges on decks above
edge_id popups; 64-bit ids stay exact
anything else shown in the popup, queryable from JavaScript

duckOSM (duckosm export-gis) exports exactly this.

Drive it from JavaScript

The saved page exposes window.rs* functions and rs:* events:

const ids = rsQuery(p => p.maxspeed_kmh > 30); // feature ids whose properties match
rsColor(ids, "#ff00aa");  rsFocus(ids);       // paint them, fit the camera
document.addEventListener("rs:select", e => console.log(e.detail.properties));

Full API: web backend → JavaScript API.

For AI coding agents

  • skills/roadstyle/SKILL.md: a skill for agents that use roadstyle (the one call, the data contract, the JS API, the traps). Install it for Claude Code:
    mkdir -p ~/.claude/skills/roadstyle && curl -fsSL -o ~/.claude/skills/roadstyle/SKILL.md \
      https://raw.githubusercontent.com/Khoshkhah/roadstyle/main/skills/roadstyle/SKILL.md
    
  • AGENTS.md: for agents working on this repo.
  • llms.txt: the docs site as a link list for LLMs.

Documentation

khoshkhah.github.io/roadstyle: gallery · every parameter · web backend & JS API · palettes & settings · base maps & API keys · web vs folium vs lonboard · vs .explore() / kepler.gl · changelog

License

MIT. Base-map tiles come from third-party services (CARTO, OSM, Esri) with their own attribution and terms.

Release files for roadstyle 0.7.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 roadstyle 0.7.0
File Size Uploaded
roadstyle-0.7.0.tar.gz 406.6 kB Details

Built distribution (wheel)

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

Total release size: 798.5 kB

Release files / roadstyle-0.7.0.tar.gz

Download URL roadstyle-0.7.0.tar.gz
Size 406.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ce4eb3a83a741815e10b144f5721889edc9de55e724a5dd778dd30e6a298e39f
BLAKE2b-256 checksum
How to use checksums
aa0d44963045d20995dc667a6f27e4cfa30b5bb785051fbec39c83cc0b02ce5e
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 Sep 27, 2026.

Transparency log

Release files / roadstyle-0.7.0-py3-none-any.whl

Download URL roadstyle-0.7.0-py3-none-any.whl
Size 391.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9ba047ece9edc23785452eac3860a275a81a9383f66bfc61422bc8dc480594c
BLAKE2b-256 checksum
How to use checksums
44ce7ed62f5bae33d36d9f415e198ea60324465bf0445b875402ce7bd9638b71
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 Sep 27, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.1

2 release files

0.9.0

2 release files

0.8.6

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

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