Skip to main content

Python bindings for libosmium, the data processing library for OSM data, with numpy interface

Project description

# npyosmium

Fork of [pyosmium](https://github.com/osmcode/pyosmium), including (only one for the time being) efficient numpy interface.

# pyosmium

Provides Python bindings for the [Libosmium](https://github.com/osmcode/libosmium) C++ library, a library for working with OpenStreetMap data in a fast and flexible manner.

[![Github Actions Build Status](https://github.com/agrenott/npyosmium/workflows/CI/badge.svg)](https://github.com/agrenott/nyosmium/actions?query=workflow%3ACI) [![PyPI version](https://badge.fury.io/py/npyosmium.svg)](https://badge.fury.io/py/npyosmium)

## Installation

npyosmium works with Python >= 3.8. Pypy is known to not work.

### Using Pip

The recommended way to install npyosmium is via pip:

pip install npyosmium

We provide binary wheels for Linux and Windows 64 for all actively maintained Python versions.

For other versions, a source wheel is provided. Make sure to install all external dependencies first. On Debian/Ubuntu-like systems, the following command installs all required packages:

sudo apt-get install build-essential cmake libboost-dev

libexpat1-dev zlib1g-dev libbz2-dev

### Installing from source

#### Prerequisites

npyosmium has the following dependencies:

### Compiling from Source

Get the latest versions of libosmium, protozero and pybind11 source code. It is recommended that you put them in a subdirectory contrib.

You can do this by cloning their repositories into that location.

Following commands should achieve this:

` mkdir contrib cd contrib git clone https://github.com/osmcode/libosmium.git git clone https://github.com/mapbox/protozero.git git clone https://github.com/pybind/pybind11.git `

You can also set custom locations with LIBOSMIUM_PREFIX, PROTOZERO_PREFIX and PYBIND11_PREFIX respectively.

` git clone --quiet --depth 1 https://github.com/osmcode/libosmium.git contrib/libosmium git clone --quiet --depth 1 https://github.com/mapbox/protozero.git contrib/protozero git clone --quiet https://github.com/pybind/pybind11.git contrib/pybind11 `

To use a custom boost installation, set BOOST_PREFIX.

To compile the bindings during development, you can use [build](https://pypa-build.readthedocs.io/en/stable/). On Debian/Ubuntu-like systems, install python3-build, then run:

` sudo apt install build-essential cmake libsparsehash-dev libexpat1-dev libboost-dev zlib1g-dev libbz2-dev liblz4-dev pip install build python3 -m build -w `

To compile and install the bindings, run

pip install [–user] .

## Examples

The example directory contains small examples on how to use the library. They are mostly ports of the examples in Libosmium and osmium-contrib.

## Testing

There is a small test suite in the test directory. This provides unit test for the python bindings, it is not meant to be a test suite for Libosmium.

Testing requires pytest and pytest-httpserver. On Debian/Ubuntu install the dependencies with:

sudo apt-get install python3-pytest python3-pytest-httpserver

The test suite can be run with:

pytest test

## Documentation

To build the documentation you need [Sphinx](http://sphinx-doc.org/) and the [autoprogram extension](https://pythonhosted.org/sphinxcontrib-autoprogram/) On Debian/Ubuntu install python-sphinx sphinxcontrib-autoprogram or python3-sphinx python3-sphinxcontrib.autoprogram.

First compile the bindings as described above and then run:

cd doc make html

For building the man pages for the tools run:

cd doc make man

## Bugs and Questions

If you find bugs or have feature requests, please report those in the [github issue tracker](https://github.com/agrenott/npyosmium/issues/).

For general questions about using pyosmium you can use the [OSM development mailing list](https://lists.openstreetmap.org/listinfo/dev) or ask on [OSM help](https://help.openstreetmap.org/).

## License

npyosmium is available under the BSD 2-Clause License. See LICENSE.TXT.

## Authors

Sarah Hoffmann (lonvia@denofr.de), Aurélien Grenotton (agrenott@gmail.com)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

npyosmium-3.7.0-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12 Windows x86-64

npyosmium-3.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

npyosmium-3.7.0-cp312-cp312-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

npyosmium-3.7.0-cp312-cp312-macosx_10_9_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

npyosmium-3.7.0-cp311-cp311-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11 Windows x86-64

npyosmium-3.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

npyosmium-3.7.0-cp311-cp311-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

npyosmium-3.7.0-cp311-cp311-macosx_10_9_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

npyosmium-3.7.0-cp310-cp310-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.10 Windows x86-64

npyosmium-3.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

npyosmium-3.7.0-cp310-cp310-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

npyosmium-3.7.0-cp310-cp310-macosx_10_9_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

npyosmium-3.7.0-cp39-cp39-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.9 Windows x86-64

npyosmium-3.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

npyosmium-3.7.0-cp39-cp39-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

npyosmium-3.7.0-cp39-cp39-macosx_10_9_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

npyosmium-3.7.0-cp38-cp38-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.8 Windows x86-64

npyosmium-3.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

npyosmium-3.7.0-cp38-cp38-macosx_10_9_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file npyosmium-3.7.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7d91f5de713cb5997945065d3f82fe7ebea0883bf3a45490f9fdffaf39682d1e
MD5 0a8b882248f4b22f32ecff81e34b3fcf
BLAKE2b-256 6c485c3873da632c9c3f6d8324149c44d62c63d6044f91e830c05e75fed73959

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 baf25b6989bfdf53dfff6b2c580d30ebc76f2d5369dd34efc2d0a3e47d537760
MD5 72aac0bba684c511163da90f2b1298c5
BLAKE2b-256 0a520ad477cb73ce41cf58068e641ea698edc6c7e58012612da2d270205dcb65

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f2d548e8e647156168f0e2d770c8747729074c99e4ffceb990894c7d5a2cdc35
MD5 dace3d024189229eb6856b50c87dcdf8
BLAKE2b-256 d9bf5524e1c490508c025b440dde12a60fa3e9e451c5ab9845d7850abc9b1769

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 65c1d3fda0b992dc5185a4fec0c856a94e2494da9dcb9bad496c399893137597
MD5 3099d005fa52196951ef83c6ba493818
BLAKE2b-256 0fcb205a1f66507d3fe8dca8df57c433fa2420fc1cb95c20bdcbdd09e979e268

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2d669903d72ac13916392ff6eafe75938cc10d634cbb1bf24a942846134aa572
MD5 42fb1b36b1321f2cda4e98a07d777f59
BLAKE2b-256 7944620faff43be2a4f7c9320841288d92b16aefdb3c97655c17a346c5382fb3

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d14fea9543c5a63bfc02cc2ea4b28566e9288848ac0a9cce812a1d0443996917
MD5 f35e45b0c969567fea6df86e6b3b57e3
BLAKE2b-256 df1f8db9a0aa014660788809d2705d8e01526cc3a1311de2f455d4f5c9dea09a

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b94ba6daaf8e691b56a855c95a38143ee3bffa20570f6cfab215974940ec90d9
MD5 77656d12dbbc5acae40f2b7342e41c07
BLAKE2b-256 c680195f6dd76c3d79455b4bba14d225998511620db70805ac6a71a9b24403ae

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ca55f8d698623d33fe868fef466dfc86f00161473528b8b40e424e9b490d6fa0
MD5 19f58e9ec2275ec66df26976ad11c8e3
BLAKE2b-256 2ec630bbe367a9c58c52b109911bada2c9a8982199d3edf9154db57f01b8f67c

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 06ab3e22d83f5453d58e461cb61809b2ceca087b0dd45345e180e67992a9d20d
MD5 0e2753c5a9297e01e65d2f353654dd04
BLAKE2b-256 6687745668f3881f18b14875f2fd007e519fba6f6265c1269b198f9ff2c42ade

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26e30e5fc9b4cc2058da0050ede99386dc47cf7d175d00829818f21fdb3e2921
MD5 1a6a02a56d101a794b4b46c2dddc9a50
BLAKE2b-256 7e5e5f9512b9573856cf092568566a93d411b4d5898ba69c0a187b65fa31379b

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 113781b33930c59528eeae30e52a2a54ef91350b6d5eb7de755c82c4758c1534
MD5 f172d829e8820b6a420b80bc989a3c1c
BLAKE2b-256 bdaf0eb8cf202dbde0a6f1c49086662258007445401c8d5d9815c92c7c515afe

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6fc26555e5afdad8a15e516aa8a94b27ee952584e8a4b784826664e7bb18e7bb
MD5 13f36c36e8734918f8071f590750eafa
BLAKE2b-256 14fc3b131be5095d418188ce07bdff527c34c59284790c58649ac87f331a450f

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: npyosmium-3.7.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for npyosmium-3.7.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8136c8df519d43b17fe8f0338460b5975778ae72f6305656f6fd034befe9f374
MD5 bc61993caa2897724d1e321ac576f776
BLAKE2b-256 725234c30a967baed5026a44417ee285161dc234994d4f4ce1114dc2822ecd18

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ebb88a25c5d60e5c84d47cd89ce753aa5b8be5a8014136fdb3ca1215882ad9ea
MD5 beee58a5183002ff948a79721ca34d49
BLAKE2b-256 8d1141dc49d3ed7dba2938d3515e6bf851880cebd79a1abfbfe3590c33bff497

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e370c36a9cc76e9555542d83d8dba639e1ac74802d8bcff89328db8b3c4c38e8
MD5 25cf93495d81fe3363beeeefcfc71804
BLAKE2b-256 4f5f4a879f7ea3d68a42812c3d70be95dd667825ee9a47daaa68614680bca96e

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 075a5ec23aa4416296817b1f3b38e2b5df58b2a1e6fc20a350765d1fae5bb716
MD5 c7176e58e661861b9fd2643c4da802a2
BLAKE2b-256 d1d2ae530cdbd6d650b2eb840c4dbb3e1aa81a828d5269d3088260162908bb43

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: npyosmium-3.7.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for npyosmium-3.7.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 5585e6d072d0b5ca318cec095850aabf11a5de3b16393c661fa3ba832460c079
MD5 0f64891e42f04ebed9158af92c74d62f
BLAKE2b-256 a7ad63c54fc200c18931292b04887576e2613052a2cbbbd6a569212ca2fc171d

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eceece0f3ecb870315161852bdd5ef0879eaa6cde23d614210e052e45ba17106
MD5 8c9cb001896646089274a63c1e78b510
BLAKE2b-256 2840721c346ba412aa9e89f48539c6c7a226f62525cd647644ec582e85a56e4d

See more details on using hashes here.

File details

Details for the file npyosmium-3.7.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for npyosmium-3.7.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 67ba87578c14094d8d6bcdd7f19d9c240177244b125adff5d87d2665b1203b26
MD5 f67cb5ca7010351e987b38480baeaebe
BLAKE2b-256 cabef3d61a99876a959110fcc21e2f017f9579b80cf0fd2dd749f55490ae63f9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page