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. Click any road to see it in Google Street View, looking the way it runs.
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_edges(edges, street_view="window") # + a floating Street View window
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.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| roadstyle-0.5.0.tar.gz | 404.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| roadstyle-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 794.7 kB
Release files / roadstyle-0.5.0.tar.gz
| Download URL | roadstyle-0.5.0.tar.gz |
|---|---|
| Size | 404.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8adcaf3599ce9e54bd28ba783d0038d45452cd89cce8d7e44df61353e031f0f
|
|
BLAKE2b-256 checksum How to use checksums |
28e2dbe39d583fbb099b60a6234f46a7d720e59bc1b61cc60d08b6d250a5ed49
|
| 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 logRelease files / roadstyle-0.5.0-py3-none-any.whl
| Download URL | roadstyle-0.5.0-py3-none-any.whl |
|---|---|
| Size | 390.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e335218b436feda1542f7d88db34931f35c321a192c59682d980feb3c108e7e1
|
|
BLAKE2b-256 checksum How to use checksums |
26695f9a13bd8a258b6655b480673e5902e88d6e2762927d5185ffd5891f86f2
|
| 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