Skip to content
Back to search

pyrosm

Read OpenStreetMap data from Protobuf files into GeoDataFrame with Python, faster.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked yesterday

Check it deeper on your machine

It has changed since its scan on 19 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/pyrosm/pyrosm with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/pyrosm/pyrosm'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/pyrosm--pyrosm/badge.svg)](/listings/pyrosm--pyrosm)

HTML

<a href="/listings/pyrosm--pyrosm"><img src="/api/listings/pyrosm--pyrosm/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Pyrosm is distributed via PyPI and conda-forge.

Install pyrosm with pip:

`$ pip install pyrosm`

pip installs prebuilt wheels of pyrosm and its dependencies, so nothing is compiled. Wheels are published for CPython 3.11–3.15 on glibc-based Linux (x86_64 and aarch64), macOS (Intel and Apple silicon) and Windows on x86_64.

You can also install pyrosm from conda-forge with [mamba](https://mamba.readthedocs.io/) (or its standalone variant [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html)), a fast drop-in replacement for `conda`. If you don't have it yet, download and install mamba via Miniforge from the [conda-forge download page](https://conda-forge.org/download/) — it ships mamba preconfigured with the conda-forge channel. Then install pyrosm with:

`$ mamba install -c conda-forge pyrosm`

or, with micromamba:

`$ micromamba install -c conda-forge pyrosm`

(the same command works with `conda` if you have it).

Troubleshooting

If pip starts building pyrosm from source, no wheel matches your platform or Python version, and the build needs a C compiler. On musl-based Linux such as Alpine, and on Windows on ARM, GeoPandas' dependency pyogrio has no wheels either, and building it needs the GDAL library; in Docker, a Debian-based image such as `python:3.12-slim` gets wheels for everything. On the platforms conda-forge supports, which do not include musl-based Linux, installing from conda-forge avoids building from source.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 145 lines
  1. <p align="center">
  2. <img src="resources/img/pyrosm_logo_2.png" alt="Pyrosm" width="660">
  3. </p>
  4. # Pyrosm – Python’s Rapid OSM Parser
  5. [![Conda Version](https://img.shields.io/conda/vn/conda-forge/pyrosm.svg)](https://anaconda.org/conda-forge/pyrosm)
  6. [![PyPI version](https://badge.fury.io/py/pyrosm.svg)](https://badge.fury.io/py/pyrosm)
  7. [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyrosm.svg?logo=python&logoColor=%23fff)](https://pypi.org/project/pyrosm)
  8. [![Documentation Status](https://readthedocs.org/projects/pyrosm/badge/?version=latest)](https://pyrosm.readthedocs.io/en/latest/?badge=latest)
  9. [![Coverage Status](https://codecov.io/gh/pyrosm/pyrosm/branch/main/graph/badge.svg)](https://codecov.io/gh/pyrosm/pyrosm)
  10. [![CodeFactor](https://www.codefactor.io/repository/github/pyrosm/pyrosm/badge)](https://www.codefactor.io/repository/github/pyrosm/pyrosm)
  11. [![PyPI - Downloads](https://img.shields.io/pypi/dm/pyrosm?color=yellow&label=Downloads)](https://pypistats.org/packages/pyrosm)
  12. [![Downloads (PyPI total)](https://static.pepy.tech/personalized-badge/pyrosm?period=total&units=international_system&left_color=grey&right_color=orange&left_text=Downloads%20(pypi))](https://pepy.tech/project/pyrosm)
  13. [![Downloads (conda-forge total)](https://img.shields.io/conda/dn/conda-forge/pyrosm?label=Downloads%20%28conda-forge%29)](https://anaconda.org/conda-forge/pyrosm)
  14. [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3755057.svg)](https://doi.org/10.5281/zenodo.3755057)
  15. [![License](https://anaconda.org/conda-forge/pyrosm/badges/license.svg)](https://anaconda.org/conda-forge/pyrosm/)
  16. **Pyrosm** is a Python library for reading OpenStreetMap data from Protocolbuffer Binary Format -files (`*.osm.pbf`) into Geopandas GeoDataFrames.
  17. Pyrosm makes it easy to extract various datasets from OpenStreetMap pbf-dumps including e.g. road networks, buildings,
  18. Points of Interest (POI), landuse and natural elements. Also fully customized queries are supported which makes it possible
  19. to parse the data from OSM with more specific filters.
  20. **Pyrosm** is easy to use and it provides a somewhat similar user interface as [OSMnx](https://github.com/gboeing/osmnx).
  21. The main difference between pyrosm and OSMnx is that OSMnx reads the data over internet using OverPass API, whereas pyrosm reads the data from local OSM data dumps
  22. that can be downloaded e.g. from [GeoFabrik's website](https://download.geofabrik.de/). The library has been developed by keeping performance in mind, hence, it is mainly written in Cython (*Python with C-like performance*) which makes it fast to parse OpenStreetMap data from PBF files. With its out-of-core ("streaming") engine, the default reader, it is possible to read whole-country (or even continent) extracts quickly without running out of
  23. memory. Pyrosm decodes the PBF data with [Google's Protocol Buffers](https://protobuf.dev/) library (using its fast `upb` C backend). Protocol Buffers is a commonly used and efficient method to serialize and compress structured data which is also used by OpenStreetMap contributors to distribute the OSM data in PBF format (Protocolbuffer Binary Format).
  24. > **Backend change.** Since **v0.8.0**, the backend used to parse the protocol-buffer messages is [Google's Protobuf](https://protobuf.dev/) (its fast C `upb` backend) instead of the previously used [Pyrobuf](https://github.com/appnexus/pyrobuf). The switch was made for maintainability and installation reliability: Pyrobuf is no longer maintained and its source build fails with modern `setuptools`, which broke `pip install pyrosm`, whereas Google's Protobuf is actively maintained and ships prebuilt wheels and conda-forge packages for every Python version pyrosm supports. The change does **not** slow down parsing — see the [backend benchmark](https://github.com/pyrosm/pyrosm/blob/main/docs/benchmarks/README.md). **v0.7.0 was the last release that used Pyrobuf.**
  25. > **Out-of-core ("streaming") engine.** Pyrosm reads with its out-of-core engine by default: `OSM(filepath)` decodes PBF files in a **single streaming pass with bounded memory**, decodes larger files **in parallel** on threads (`workers="auto"`, the default), and caches each layer's result automatically. It reads whole-country and even **whole-continent** extracts (e.g. all of South America) quickly on modest machines without running out of memory. `OSM(filepath, engine="in_memory")` selects the in-memory reader, which parses the whole file once and serves every read of the reader from it.
  26. **Documentation** is available at [https://pyrosm.readthedocs.io](https://pyrosm.readthedocs.io/en/stable/).
  27. ## Current features
  28. - download PBF data easily from any location in the world
  29. - find and download the right extract for a bounding box or a place name (NEW in v0.9.0)
  30. - download the smallest single extract that contains an area, comparing Geofabrik, BBBike and Movisda extracts (NEW in v0.14.0)
  31. - read street networks (separately for driving, cycling, walking and all-combined)
  32. - read buildings from PBF
  33. - read Points of Interest (POI) from PBF
  34. - read landuse from PBF
  35. - read "natural" from PBF
  36. - read boundaries from PBF (such as administrative borders)
  37. - read any other data from PBF by using a custom user-defined filter, including regular-expression values and Overpass-style filters (NEW in v0.11.0)
  38. - read large PBF extracts (country level, even some continents) with bounded memory using the out-of-core ("streaming") engine, the default reader, with parallel decoding and automatic result caching
  39. - filter data based on bounding box
  40. - control which OSM tags are parsed into columns
  41. - crop a PBF to a smaller area and write modified OSM data back to PBF (NEW in v0.9.0), or export only selected layers (NEW in v0.11.0)
  42. - merge overlapping PBF extracts, such as two country extracts around a border town, into one file (NEW in v0.14.0)
  43. - edit the geometry of an OSM network — move nodes, reshape ways, delete elements — and write it back to PBF (NEW in v0.12.0)
  44. - export networks as a directed graph to `igraph`, `networkx` and `pandarm`, optionally with topological simplification (NEW in v0.11.0)
  45. - add the passages, platforms, stairs, escalators and lifts inside stations to a walking network, with the level at each end of an edge, and view the network in 3D
  46. ## Install
  47. Pyrosm is distributed via PyPI and conda-forge.
  48. Install pyrosm with pip:
  49. `$ pip install pyrosm`
  50. pip installs prebuilt wheels of pyrosm and its dependencies, so nothing is compiled. Wheels are published for CPython 3.11–3.15 on glibc-based Linux (x86_64 and aarch64), macOS (Intel and Apple silicon) and Windows on x86_64.
  51. You can also install pyrosm from conda-forge with [mamba](https://mamba.readthedocs.io/) (or its standalone variant [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html)), a fast drop-in replacement for `conda`. If you don't have it yet, download and install mamba via Miniforge from the [conda-forge download page](https://conda-forge.org/download/) — it ships mamba preconfigured with the conda-forge channel. Then install pyrosm with:
  52. `$ mamba install -c conda-forge pyrosm`
  53. or, with micromamba:
  54. `$ micromamba install -c conda-forge pyrosm`
  55. (the same command works with `conda` if you have it).
  56. ### Troubleshooting
  57. If pip starts building pyrosm from source, no wheel matches your platform or Python version, and the build needs a C compiler. On musl-based Linux such as Alpine, and on Windows on ARM, GeoPandas' dependency pyogrio has no wheels either, and building it needs the GDAL library; in Docker, a Debian-based image such as `python:3.12-slim` gets wheels for everything. On the platforms conda-forge supports, which do not include musl-based Linux, installing from conda-forge avoids building from source.
  58. ## When should I use Pyrosm?
  59. Pyrosm can of course be used whenever you need to parse data from OSM into geopandas GeoDataFrames.
  60. However, `pyrosm` is better suited for situations where you want to fetch data for whole city or larger regions (even whole country).
  61. If you are interested to fetch OSM data for smaller areas such as neighborhoods, or search data around a specific location/address,
  62. we recommend using [OSMnx](https://github.com/gboeing/osmnx) which is more flexible in terms of specifying the area of interest.
  63. That being said, it is also possible to extract neighborhood level information with pyrosm and filter data based on a bounding box
  64. (see [docs](https://pyrosm.readthedocs.io/en/stable/reading_osm_data.html#filtering-data-based-on-bounding-box)).
  65. ## How to use?
  66. Using `pyrosm` is straightforward. See [docs](https://pyrosm.readthedocs.io/en/stable/reading_osm_data.html)
  67. for instructions how to use the library.
  68. ## Download responsibly
  69. The data providers that pyrosm downloads from (Geofabrik, BBBike, Movisda) and the Nominatim geocoder are free services shared by everyone. Download an extract once and reuse it, and keep large regions current with `pyosmium-up-to-date` instead of downloading them again. pyrosm refuses a 4th full download of one URL within 24 hours and downloads one file at a time from each host. [Download responsibly](https://pyrosm.readthedocs.io/en/stable/download_responsibly.html) explains the usage policies of these services and how pyrosm limits its downloads and geocoding requests. AI agents that write or run pyrosm code should follow the [Rules for AI coding agents](https://pyrosm.readthedocs.io/en/stable/ai_agents.html).
  70. ## Get in touch + contributions
  71. If you find a bug from the tool, have question, or would like to suggest a new feature to it, you can [make a new issue here](https://github.com/pyrosm/pyrosm/issues).
  72. We warmly welcome contributions to `pyrosm` to make it better. If you are interested in contributing to the library,
  73. please check the [contribution guidelines](https://pyrosm.readthedocs.io/en/stable/contributions.html).
  74. ## Development
  75. You can install a local development version of the tool by 1) creating an environment with the necessary packages using mamba/micromamba and 2) building pyrosm from source:
  76. 1. create an environment for one of the supported Python versions (3.11–3.15) by:
  77. - e.g. Python 3.14 (you might want to modify the env-name which is `test` by default): `$ mamba env create -f ci/314-conda.yaml` (or `$ micromamba create -f ci/314-conda.yaml`)
  78. - environment files for other versions are available under `ci/` (e.g. `ci/312-conda.yaml`)
  79. 2. build pyrosm development version from main (activate the environment first):
  80. - `pip install -e . --no-build-isolation`
  81. - (`--no-build-isolation` builds the Cython extensions against the build dependencies provided by the environment, i.e. Cython, instead of refetching and recompiling it in an isolated build environment)
  82. You can run tests with `pytest` by executing:
  83. `$ pytest . -v`
  84. ## Citing pyrosm
  85. If you use pyrosm in your research or other work, please cite it. Pyrosm is archived on [Zenodo](https://doi.org/10.5281/zenodo.3755057), which provides a citable DOI (`10.5281/zenodo.3755057`, always resolving to the latest version). An example citation for the pyrosm version 0.29.0 is as follows:
  86. > Tenkanen, H. (2026). *pyrosm: A Python library for reading and writing OpenStreetMap PBF data with GeoDataFrames*. (v0.29.0) Zenodo. https://doi.org/10.5281/zenodo.3755057
  87. A BibTeX entry and version-specific DOIs are available in the [documentation](https://pyrosm.readthedocs.io/en/stable/citation.html) and on the [Zenodo record](https://doi.org/10.5281/zenodo.3755057).
  88. ## License and copyright
  89. Pyrosm is licensed under the BSD 3-Clause License (see [license](LICENSE)). pyrosm includes country borders built from the national boundaries of OpenStreetMap. The countries' defaults for shared foot and cycle paths come from the tables of the OSM wiki page [OSM tags for routing/Access restrictions](https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access_restrictions).
  90. The OSM data is downloaded from two sources:
  91. [![Website](https://img.shields.io/website/https/download.geofabrik.de?label=Data%20source&up_color=9cf&up_message=http%3A%2F%2Fdownload.geofabrik.de)](https://download.geofabrik.de/)
  92. [![Website](https://img.shields.io/website/https/download.bbbike.org/osm?label=Data%20source&up_color=9cf&up_message=http%3A%2F%2Fdownload.bbbike.org%2Fosm)](https://download.bbbike.org/osm/)
  93. Data &copy; [Geofabrik GmbH](http://www.geofabrik.de/), [BBBike](https://download.bbbike.org/), [Movisda](https://osm.download.movisda.io/) and [OpenStreetMap Contributors](http://www.openstreetmap.org/)
  94. All data from the [OpenStreetMap](https://www.openstreetmap.org) is licensed under the [OpenStreetMap License](https://www.openstreetmap.org/copyright).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.