osmdb
osmdb imports OpenStreetMap PBF files into a local database and provides fast, read-only access from a CLI, Rust, or Python.
Import a PBF once, then query locations, tagged nodes, ways, and relations by their OSM IDs. Node coordinates are stored in a memory-mapped file for O(1) lookups; the remaining entities are stored in RocksDB.
CLI
The CLI requires Rust 1.85 or newer, a C/C++ build toolchain, and libclang.
cargo install osmdb
osmdb import --pbf world.osm.pbf --output ./world-db
The output directory must be new. Once the import completes, look up one or more IDs:
osmdb lookup --db ./world-db location 240109189
osmdb lookup --db ./world-db node 123456789
osmdb lookup --db ./world-db way 12345678 87654321
osmdb lookup --db ./world-db relation 123456
See CLI usage for prerequisites, aliases, and command details.
Rust
[dependencies]
osmdb = "0.1.0"
use osmdb::DatabaseReader;
let reader = DatabaseReader::open("world-db")?;
let location = reader.get_location(240109189)?;
let node = reader.get_node(123456789)?;
let way = reader.get_way(12345678)?;
let relation = reader.get_relation(123456)?;
Each lookup returns Ok(Some(entity)) when the ID exists and Ok(None) when it does not. See the Rust guide for geometry and iteration.
Python
The typed Python package requires CPython 3.10 or newer and reads databases created by the CLI.
pip install osmdb
from osmdb import Database
with Database("world-db") as db:
location = db.get_location(240109189)
way = db.get_way(12345678)
if way is not None:
coordinates = db.get_way_geometry(way)
See the Python guide for typed entities, iterators, and source builds.
Documentation
Licensed under the Apache License 2.0.
Metadata
Release files for osmdb 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| osmdb-0.1.1.tar.gz | 47.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| osmdb-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details |
Total release size: 4.2 MB
Release files / osmdb-0.1.1.tar.gz
| Download URL | osmdb-0.1.1.tar.gz |
|---|---|
| Size | 47.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0662f97a2730b7b76513f8d72e9df57382675589518e0e77e1a7e752edd3eae9
|
|
BLAKE2b-256 checksum How to use checksums |
9841d11ae4d55eba5d82bdb5285630f0781fecf6fae483b6f118ff73947dd911
|
| 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 9, 2026.
Transparency logRelease files / osmdb-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | osmdb-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c4a6622783d69b0ab72a0ea658ac6b719b027d321b3aea504c584fc0f4fc6e06
|
|
BLAKE2b-256 checksum How to use checksums |
f10ab99cd174603d25e6b63135a79412e2ad4c1042933685427bff11eefadde4
|
| 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 9, 2026.
Transparency log