osmium
Python bindings for libosmium, the data processing library for OSM data
Decision gist · record as of 2026-08-14
Yes, if you need to process OpenStreetMap data at scale. osmium is the standard Python interface to Libosmium and offers the performance and flexibility required for serious OSM work. Install friction is moderate—you'll need system libraries and a C++ compiler—but prebuilt wheels handle most common environments. No known security issues, active maintenance, and a permissive license make it a solid choice. Skip it if you only need lightweight, read-only access to OSM via web APIs.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires expat, libz, and libbz2 development headers.
- On Debian/Ubuntu: sudo apt-get install build-essential cmake libexpat1-dev zlib1g-dev libbz2-dev.
- Requires Python >= 3.8; PyPy is not supported.
License · maintenance · safety
BSD-2-Clause (permissive) — BSD-2-Clause is a permissive open-source license allowing commercial and private use with minimal restrictions. You must retain the license notice and disclaimer, but there are no copyleft obligations.
last release 2026-04-02 (134 days) · last repo commit 2026-04-02 · 391 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 312,287 downloads/mo, #7,726 on PyPI
Alternatives
Verify before relying
pip install osmium
import osmium
class MyHandler(osmium.SimpleHandler):
def node(self, n):
print(n.id, n.location.lat, n.location.lon)
handler = MyHandler()
handler.apply_file('data.osm.pbf')- Specific performance characteristics or throughput limits for large OSM datasets.
- Whether requests dependency is used internally or only as a transitive requirement.
- Compatibility with alternative OSM processing libraries and typical data pipeline patterns.
What it is and what it does
osmium is a Python wrapper around Libosmium, a high-performance C++ library for reading and processing OpenStreetMap data. It allows developers to parse OSM files (typically in PBF or XML format) and extract geographic features—nodes, ways, relations—with callbacks or streaming handlers. The library is designed for bulk data processing tasks where speed matters, such as extracting specific map features, analyzing road networks, or transforming raw OSM data into application-specific formats.
The package depends on requests and requires system libraries (expat, libz, libbz2) for compilation. It supports Python 3.8 through 3.14 on CPython and provides prebuilt wheels for most platforms, though compilation from source may be necessary on less common architectures. The codebase is actively maintained, with a stable API and comprehensive documentation.
Use it for
- Extract all buildings or roads from a regional OSM dataset for mapping or urban planning applications.
- Parse and filter OSM change files to detect new or modified geographic features in near-real-time.
- Convert raw OSM data into a custom database or GIS format for downstream analysis.
- Analyze road networks or pedestrian infrastructure by traversing ways and their node relationships.
- Build tile-based map renderers or geographic search indexes from OSM source data.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to process OpenStreetMap data at scale.
osmium is the standard Python interface to Libosmium and offers the performance and flexibility required for serious OSM work. Install friction is moderate—you'll need system libraries and a C++ compiler—but prebuilt wheels handle most common environments. No known security issues, active maintenance, and a permissive license make it a solid choice. Skip it if you only need lightweight, read-only access to OSM via web APIs.
Install
osmium on PyPI
Before you install
Medium install friction due to C++ compilation requirements. The package requires development headers for expat, libz, and libbz2 on Linux/macOS. Prebuilt wheels are available for Python 3.8–3.14 across common platforms (macOS, Linux, Windows), reducing friction for standard environments. Last release was 134 days ago; repository is active with recent commits.
Requires expat, libz, and libbz2 development headers. On Debian/Ubuntu: sudo apt-get install build-essential cmake libexpat1-dev zlib1g-dev libbz2-dev. Requires Python >= 3.8; PyPy is not supported.
License in practice
BSD-2-Clause is a permissive open-source license allowing commercial and private use with minimal restrictions. You must retain the license notice and disclaimer, but there are no copyleft obligations.
Quickstart
pip install osmium
import osmium
class MyHandler(osmium.SimpleHandler):
def node(self, n):
print(n.id, n.location.lat, n.location.lon)
handler = MyHandler()
handler.apply_file('data.osm.pbf')
Verify before relying
- Specific performance characteristics or throughput limits for large OSM datasets.
- Whether requests dependency is used internally or only as a transitive requirement.
- Compatibility with alternative OSM processing libraries and typical data pipeline patterns.
Package facts
| License | BSD-2-Clause permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagerequests |
| Maintenance | Actively maintained 134 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 312,287 / month, #7,726 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: C++Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Free Threading :: 2 - BetaProgramming Language :: Python :: Implementation :: CPythonTopic :: Scientific/Engineering :: GISTyping :: Typed |
Evidence: osmium-4.3.1-cp310-cp310-macosx_11_0_arm64.whl; osmium-4.3.1-cp310-cp310-macosx_11_0_x86_64.whl; osmium-4.3.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; osmium-4.3.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; osmium-4.3.1-cp310-cp310-win_amd64.whl; osmium-4.3.1-cp310-cp310-win_arm64.whl; osmium-4.3.1-cp311-cp311-macosx_11_0_arm64.whl; osmium-4.3.1-cp311-cp311-macosx_11_0_x86_64.whl; osmium-4.3.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; osmium-4.3.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; osmium-4.3.1-cp311-cp311-win_amd64.whl; osmium-4.3.1-cp311-cp311-win_arm64.whl; osmium-4.3.1-cp312-cp312-macosx_11_0_arm64.whl; osmium-4.3.1-cp312-cp312-macosx_11_0_x86_64.whl; osmium-4.3.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; osmium-4.3.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; osmium-4.3.1-cp312-cp312-win_amd64.whl; osmium-4.3.1-cp312-cp312-win_arm64.whl; osmium-4.3.1-cp313-cp313-macosx_11_0_arm64.whl; osmium-4.3.1-cp313-cp313-macosx_11_0_x86_64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “openstreetmap data processing python”
- osmiumosmium provides Python bindings for the Libosmium C++ library,…
- overpyA Python wrapper for querying the Overpass API to retrieve and parse…
- osmnxOSMnx downloads, models, and analyzes street networks and geospatial…
Give your agent the search over MCP, or paste the wish link into any chat.
More GIS packages
Shapely provides Python tools for creating, manipulating, and analyzing 2D geometric objects (points, lines, polygons) using the GEOS library, with both scalar and vectorized NumPy-based operations.
pyproj provides a Python interface to PROJ, enabling cartographic projections and coordinate system transformations for geospatial applications.
GeoPandas extends pandas DataFrames to handle geographic data, combining pandas operations with shapely geometry and spatial analysis capabilities that would otherwise require a spatial database.
Install it if you work with geographic data in Python and want to avoid setting up a spatial database or learning a separate GIS tool.
geopy is a Python client for geocoding and distance calculation that converts addresses to coordinates and vice versa using multiple web-based geocoding services, and computes geodesic and great-circle distances between geographic points.
Install it if you need geocoding or distance calculations in your application.
Pyogrio provides fast, bulk-oriented read and write access to vector spatial data formats (Shapefile, GeoPackage, GeoJSON, etc.) via GDAL/OGR bindings, typically for use with GeoPandas GeoDataFrames.
h3 provides Python bindings to Uber's H3 geospatial indexing library, converting geographic coordinates into hierarchical hexagonal grid cells and performing spatial operations on them.
See also osmnx · overpy · osm2geojson · arcgis · GeoAlchemy2 · contextily · cityseer · pylibfdt · staticmap