--- id: osmium version: "4.3.1" license: BSD-2-Clause license_treatment: permissive maintenance: active --- # osmium — Python bindings for libosmium, the data processing library for OSM data License: permissive · Maintenance: active · Downloads: 312.3K/mo ## 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 above — verify before relying. osmium provides Python bindings for the Libosmium C++ library, enabling fast and flexible processing of OpenStreetMap data. 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 pip install osmium uv add osmium poetry add osmium ## Installing osmium 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. 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') 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. 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_current - Install friction: medium - Maintenance: active - Downloads: 312.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags openstreetmap data processing python, osm file parsing library, libosmium python bindings, geographic data extraction tools, osm pbf parsing, map data analysis python, openstreetmap bulk processing, geospatial, openstreetmap, data-processing [View on SkillFed](https://skillfed.io/packages/osmium) · [View on PyPI](https://pypi.org/project/osmium/)