openwalkscore

Open, API-key-free walkability scores (0-100) from OpenStreetMap: network-distance amenity access with distance decay and street-connectivity penalties, for points, grids and cities.

Version 0.1.2 · Python >=3.9 · MIT licence
pip install openwalkscore
PyPISourceIssuesChangelogCite (DOI)

openwalkscore

pipeline PyPI Python License: MIT DOI Downloads

Open, transparent, API-key-free walkability scores (0-100) for any point or area on Earth, computed from OpenStreetMap. It counts the everyday destinations (groceries, cafes, schools, parks, clinics, transit stops) reachable on foot along the street network and penalises poorly connected or steep streets, for urban data scientists, planners, proptech developers and students.

pip install openwalkscore
# optional: run shortest paths with networkx instead of the built-in Dijkstra
pip install "openwalkscore[networkx]"
from openwalkscore import score_point

r = score_point(48.8530, 2.3499)          # Ile de la Cite, Paris
print(r.score, r.rating)                  # e.g. 100 Excellent
print(r.subscores)                        # {'grocery': 100.0, 'restaurants_cafes': 100.0, ...}
print(r.explain())                        # plain-text, line-by-line justification

for hit in r.nearest_amenities(limit=5):
    print(f"{hit.distance_m:5.0f} m  {hit.category:<18} {hit.name}")

Every number in the method is published below and lives in an editable profile, so a score can always be reproduced, audited and adapted.

Disclaimer. openwalkscore is an independent open-source project. It is not affiliated with, endorsed by or connected to Walk Score® or Redfin. Walk Score® is a registered trademark of its owner. openwalkscore uses its own method and its own data (OpenStreetMap); its scores are not comparable to Walk Score® values and must not be presented as such.


Contents

Install

Python 3.9 or newer. The only runtime dependency is certifi (plus tomli on Python < 3.11). No API key, no account, no osmnx/geopandas stack required. The optional networkx extra only swaps the shortest-path engine; results are identical.

Quick start

The first call downloads amenities and the walking network around the point from the public Overpass API (this can take up to a minute in a dense city centre) and caches the response on disk; repeated calls are instant. python -m openwalkscore works as well as the openwalkscore command.

openwalkscore score --lat 48.8530 --lon 2.3499
openwalkscore explain --lat 48.8530 --lon 2.3499
openwalkscore grid --bbox 2.340,48.850,2.360,48.860 --cell 200 -o paris.geojson --html paris.html

Methodology

For a point p and a profile with categories c (weight W_c):

1. Amenity categories

Each OpenStreetMap feature with a location (node, or way/relation centroid) is assigned to the first category whose tag rules match (shop=* comes after the grocery and healthcare rules, so a supermarket counts as grocery, not shopping). Default profile:

Category Weight Counted (n) Ratio (r) Tags (abridged)
Grocery 3 2 0.4 shop=supermarket/convenience/greengrocer/bakery/butcher/deli, amenity=marketplace
Restaurants & cafes 3 10 0.8 amenity=restaurant/cafe/fast_food/pub/bar/food_court/ice_cream
Healthcare 1 2 0.5 amenity=pharmacy/clinic/doctors/hospital/dentist, shop=chemist, healthcare=*
Shopping 2 5 0.7 shop=* (except vacant, car, car_parts, fuel)
Schools 1 1 - amenity=school/kindergarten/childcare/college/university
Parks & play 1 2 0.5 leisure=park/playground/garden/recreation_ground/nature_reserve (not access=private)
Banks & post 1 1 - amenity=bank/atm/bureau_de_change/post_office
Culture & community 1 2 0.5 amenity=library/theatre/cinema/arts_centre/community_centre, tourism=museum/gallery
Transit stops 2 3 0.5 highway=bus_stop, public_transport=platform, railway=station/halt/tram_stop/subway_entrance, amenity=ferry_terminal

Run openwalkscore explain (no coordinates) to print the complete profile as JSON.

2. Walking distance

3. Distance decay

Credit for an amenity at walking distance d:

f(d) = 1                                   if d <= 400 m
f(d) = 0.5 * (1 + cos(pi * t))             if 400 m < d < 1600 m,  t = (d - 400) / 1200
f(d) = 0                                   if d >= 1600 m

The cosine taper is smooth at both ends: an amenity 700 m away earns 0.85, 1 km away 0.50, 1.3 km away 0.15. A linear ramp is available (decay.shape = "linear").

4. Diminishing returns

Within a category the amenities are ranked by credit and the best n are kept. The k-th one is weighted by

s_k = r^(k-1) / (1 + r + ... + r^(n-1))

so the shares sum to 1 and each extra cafe adds less than the previous one. The category subscore is S_c = sum_k s_k * f(d_k), between 0 and 1. Example (restaurants & cafes, n = 10, r = 0.8): one cafe next door is worth 22 % of the category, five cafes 75 %, ten cafes 100 %.

5. Access score

A = 100 * sum_c W_c * S_c / sum_c W_c

6. Network penalties

Measured within analysis_radius_m (800 m) of the point:

Penalty Metric No penalty at Full penalty at Max
Intersection density nodes where >= 3 street edges meet, per km² >= 90 /km² <= 30 /km² 10 %
Block length mean length of street segments between intersections / dead ends <= 120 m >= 240 m 10 %
Slope (only with a DEM) length-weighted mean absolute grade of those segments <= 3 % >= 15 % 10 %

Each penalty is linear between its two thresholds. They combine multiplicatively, P = 1 - prod_i (1 - P_i), capped at max_total_penalty (30 %). Penalties are skipped (and the explanation says so) when the point has no network nearby.

7. Final score

score = round(A * (1 - P))        # integer 0..100
Score Rating
90-100 Excellent
70-89 High
50-69 Moderate
25-49 Low
0-24 Very low

Profiles

Built-in profiles: default, family (schools, parks and healthcare weighted up), senior (300 m full credit, 1 km cut-off, healthcare and transit weighted up, stronger slope penalty) and transit (transit stops dominate).

A custom profile overrides a base profile key by key, from a dict or a TOML file:

# nightlife.toml
[profile]
name = "nightlife"
base = "default"

[profile.decay]
full_m = 300
zero_m = 1200
shape = "linear"

[profile.categories.restaurants_cafes]
weight = 6
max_count = 12

[profile.categories.nightclubs]          # a new category
weight = 2
tags = ["amenity=nightclub", "amenity=music_venue"]
max_count = 3
ratio = 0.6

[profile.penalties.slope]
max_penalty = 0.15
from openwalkscore import Profile, score_point

p = Profile.from_toml("nightlife.toml")
p = Profile.from_dict({"categories": {"shopping": {"weight": 0}}})   # switch a category off
score_point(52.52, 13.405, profile=p)
score_point(52.52, 13.405, profile="nightlife.toml")                  # a path works too

Unknown keys raise ValueError, so a typo never silently changes a score. Set replace_categories = true to start from an empty category list.

Python API

Function / class Purpose
score_point(lat, lon, profile="default", *, data=None, dem=None, engine="python", client=None, use_cache=True, name="") Score one point; returns WalkScoreResult.
score_grid(bbox, cell_m=250, profile="default", *, data=None, ...) Score square cells over bbox = (west, south, east, north); returns a GeoJSON FeatureCollection with score, rating, sub_<category> per cell.
compare(points, profile="default", *, data=None, ...) Score (lat, lon), (name, lat, lon) or {"name", "lat", "lon"} items; close points share one download.
WalkScorer(data, profile, dem=None, engine="python") Build the network once, call .score(lat, lon) / .grid(bbox, cell_m) many times.
WalkScoreResult score, rating, access_score, total_penalty, subscores, categories (with counted AmenityHits), penalties, metrics, distance_mode, explain(), nearest_amenities(), to_dict(), to_geojson_feature().
Profile, get_profile, list_profiles Profiles and their configuration.
OverpassClient(endpoints, timeout_s, cache_dir, cache_ttl_s, min_interval_s, retries) Download control.
load_osm(path_or_obj) Read .osm, .geojson, Overpass .json, or a dict.
WalkNetwork, dijkstra The graph and the shortest-path routine, usable on their own.
DEM.from_ascii_grid(path), DEM.from_function(fn) Elevation for the slope penalty.
render_html(obj), write_html(obj, path) Leaflet map of a result, a list of results or a grid.
from openwalkscore import WalkScorer, load_osm

scorer = WalkScorer(load_osm("district.osm"), profile="family")
results = [scorer.score(lat, lon) for lat, lon in listings]       # fast: graph built once

Using a DEM:

score_point(41.03, 28.98, dem="istanbul_wgs84.asc")              # ESRI ASCII grid in degrees

import rasterio                                                 # or any sampler you like
src = rasterio.open("dem_wgs84.tif"); band = src.read(1)
def elevation(lat, lon):
    row, col = src.index(lon, lat)
    return float(band[row, col])
score_point(41.03, 28.98, dem=elevation)

Command line

openwalkscore score   --lat LAT --lon LON [--profile P] [--json] [--html map.html]
openwalkscore explain [--lat LAT --lon LON] [--profile P]
openwalkscore grid    --bbox WEST,SOUTH,EAST,NORTH --cell 250 -o grid.geojson [--html map.html]
openwalkscore compare --point "Home,41.03,28.98" --point "Office,41.04,29.00" [--json]
openwalkscore profiles

Common options: --input FILE (offline .osm/.geojson/.json), --dem FILE.asc, --engine python|networkx, --timeout SECONDS, --endpoint URL (repeatable), --no-cache, --cache-dir DIR. Exit codes: 0 ok, 2 invalid input, 3 download failed.

explain without coordinates prints the method summary and the full profile.

Data sources and offline use

Overpass API (default). OverpassClient sends one query per area (amenities with out center, plus the walkable ways and their nodes) to public Overpass instances, trying overpass-api.de, overpass.kumi.systems and overpass.private.coffee in turn. It:

Please follow the Overpass usage policy: keep areas small and avoid parallel bulk jobs.

Offline input. data= (or --input) accepts:

HTML maps

from openwalkscore import score_point, score_grid, write_html
write_html(score_point(40.4168, -3.7038), "madrid.html")
write_html(score_grid((-3.71, 40.41, -3.69, 40.425), 200), "madrid_grid.html")

The page loads Leaflet 1.9.4 from unpkg with Subresource Integrity hashes and shows OpenStreetMap tiles with the required attribution. Data is embedded as JSON with <, > and & escaped, and all OSM-supplied text (names, tags) is inserted with textContent, so feature names cannot inject markup or script.

Limitations

Development

git clone https://gitlab.com/geophilo1/openwalkscore_sdk
cd openwalkscore_sdk
pip install -e ".[dev]"
python -m pytest            # no network needed: tests use hand-made OSM fixtures
python -m ruff check . && python -m ruff format --check src tests && python -m mypy src

Citing

@software{eminoglu_openwalkscore,
  author  = {Eminoğlu, Yusuf},
  title   = {openwalkscore},
  year    = {2026},
  version = {0.1.2},
  doi     = {10.5281/zenodo.24063354},
  url     = {https://doi.org/10.5281/zenodo.24063354}
}

If you use openwalkscore in research, please cite it via CITATION.cff:

Eminoğlu, Y. (2026). openwalkscore: open, transparent walkability scores from OpenStreetMap (version 0.1.2) [Software]. https://gitlab.com/geophilo1/openwalkscore_sdk

Related Geophilo SDKs

License and attribution

Code: MIT, © 2026 Yusuf Eminoğlu. See LICENSE.

Map data: © OpenStreetMap contributors, available under the Open Database License (ODbL). When you publish scores or maps derived from OSM data, credit OpenStreetMap accordingly.

Walk Score® is a registered trademark of its owner; this project is not affiliated with it.

Other Geophilo SDKs