h3ronpy
=======
A data science toolkit for the `H3 geospatial grid <https://h3geo.org/>`_.
.. image:: https://img.shields.io/pypi/v/h3ronpy
:alt: PyPI
:target: https://pypi.python.org/pypi/h3ronpy/
.. image:: https://readthedocs.org/projects/h3ronpy/badge/?version=latest
:alt: ReadTheDocs
:target: https://h3ronpy.readthedocs.io/
This library is not a substitute for the official `python h3 library <https://github.com/uber/h3-py>`_ - instead it provides more
high-level functions on top of H3 and integrations into common dataframe libraries.
Documentation is available on `<https://h3ronpy.readthedocs.io/>`_.
Features
--------
* H3 algorithms provided using the performant `h3o <https://github.com/HydroniumLabs/h3o>`_ library.
* Build on `Apache Arrow <https://arrow.apache.org>`_ and `pyarrow <https://arrow.apache.org/docs/python/index.html>`_ for efficient data handling.
* Dedicated APIs for the the `pandas <https://pandas.pydata.org>`_ and `polars <https://www.pola.rs/>`_ dataframe libraries. The `pandas` support includes `geopandas <https://geopandas.org>`_.
* Multi-threaded conversion of raster data to the H3 grid using `numpy arrays <https://numpy.org/>`_.
* Multi-threaded conversion of vector data, including `geopandas` `GeoDataFrames` and any object which supports the python `__geo_interface__` protocol (`shapely`, `geojson`, ...).
Most parts of this library aim to be well-performing. Benchmarking the conversion of 1000 uint64 cell
values to strings using
* a simplistic list comprehension calling ``h3-py`` ``h3_to_string``
* a numpy vectorized (``numpy.vectorize``) variant of ``h3-py`` ``h3_to_string``
* the ``cells_to_string`` function of this library (release build)
leads to the following result on a standard laptop:
.. code-block::
---------------------------------------------------------------------------------------------- benchmark: 3 tests ---------------------------------------------------------------------------------------------
Name (time in us) Min Max Mean StdDev Median IQR Outliers OPS (Kops/s) Rounds Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_cells_to_string 48.4710 (1.0) 75.5000 (1.0) 52.4252 (1.0) 1.5461 (1.0) 52.0330 (1.0) 0.4890 (1.0) 307;448 19.0748 (1.0) 4090 1
test_h3_to_string_python_list 290.5460 (5.99) 325.8180 (4.32) 297.5644 (5.68) 4.8769 (3.15) 296.1350 (5.69) 8.2420 (16.85) 806;4 3.3606 (0.18) 2863 1
test_h3_to_string_numpy_vectorized 352.9870 (7.28) 393.8450 (5.22) 360.1159 (6.87) 3.7195 (2.41) 359.4820 (6.91) 3.8420 (7.86) 447;131 2.7769 (0.15) 2334 1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Legend:
Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
OPS: Operations Per Second, computed as 1 / Mean
The benchmark implementation can be found in ``tests/polars/test_benches.py`` and uses `pytest-benchmark <https://pypi.org/project/pytest-benchmark/>`_.
Limitations
-----------
Not all functionalities of the H3 grid are wrapped by this library, the current feature-set was implemented
when there was a need and the time for it. As a opensource library new features can be requested in the form of github issues
or contributed using pull requests.
License
-------
MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/nmandery/h3ronpy",
"name": "h3ronpy",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "geo, spatial, h3, arrow, python",
"author": "Nico Mandery <nico@nmandery.net>",
"author_email": "Nico Mandery <nico@nmandery.net>",
"download_url": null,
"platform": null,
"description": "h3ronpy\n=======\n\nA data science toolkit for the `H3 geospatial grid <https://h3geo.org/>`_.\n\n.. image:: https://img.shields.io/pypi/v/h3ronpy\n :alt: PyPI\n :target: https://pypi.python.org/pypi/h3ronpy/\n\n.. image:: https://readthedocs.org/projects/h3ronpy/badge/?version=latest\n :alt: ReadTheDocs\n :target: https://h3ronpy.readthedocs.io/\n\n\nThis library is not a substitute for the official `python h3 library <https://github.com/uber/h3-py>`_ - instead it provides more\nhigh-level functions on top of H3 and integrations into common dataframe libraries.\n\nDocumentation is available on `<https://h3ronpy.readthedocs.io/>`_.\n\nFeatures\n--------\n\n* H3 algorithms provided using the performant `h3o <https://github.com/HydroniumLabs/h3o>`_ library.\n* Build on `Apache Arrow <https://arrow.apache.org>`_ and `pyarrow <https://arrow.apache.org/docs/python/index.html>`_ for efficient data handling.\n* Dedicated APIs for the the `pandas <https://pandas.pydata.org>`_ and `polars <https://www.pola.rs/>`_ dataframe libraries. The `pandas` support includes `geopandas <https://geopandas.org>`_.\n* Multi-threaded conversion of raster data to the H3 grid using `numpy arrays <https://numpy.org/>`_.\n* Multi-threaded conversion of vector data, including `geopandas` `GeoDataFrames` and any object which supports the python `__geo_interface__` protocol (`shapely`, `geojson`, ...).\n\nMost parts of this library aim to be well-performing. Benchmarking the conversion of 1000 uint64 cell\nvalues to strings using\n\n* a simplistic list comprehension calling ``h3-py`` ``h3_to_string``\n* a numpy vectorized (``numpy.vectorize``) variant of ``h3-py`` ``h3_to_string``\n* the ``cells_to_string`` function of this library (release build)\n\nleads to the following result on a standard laptop:\n\n.. code-block::\n\n ---------------------------------------------------------------------------------------------- benchmark: 3 tests ---------------------------------------------------------------------------------------------\n Name (time in us) Min Max Mean StdDev Median IQR Outliers OPS (Kops/s) Rounds Iterations\n ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n test_cells_to_string 48.4710 (1.0) 75.5000 (1.0) 52.4252 (1.0) 1.5461 (1.0) 52.0330 (1.0) 0.4890 (1.0) 307;448 19.0748 (1.0) 4090 1\n test_h3_to_string_python_list 290.5460 (5.99) 325.8180 (4.32) 297.5644 (5.68) 4.8769 (3.15) 296.1350 (5.69) 8.2420 (16.85) 806;4 3.3606 (0.18) 2863 1\n test_h3_to_string_numpy_vectorized 352.9870 (7.28) 393.8450 (5.22) 360.1159 (6.87) 3.7195 (2.41) 359.4820 (6.91) 3.8420 (7.86) 447;131 2.7769 (0.15) 2334 1\n ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n Legend:\n Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.\n OPS: Operations Per Second, computed as 1 / Mean\n\n\nThe benchmark implementation can be found in ``tests/polars/test_benches.py`` and uses `pytest-benchmark <https://pypi.org/project/pytest-benchmark/>`_.\n\nLimitations\n-----------\n\nNot all functionalities of the H3 grid are wrapped by this library, the current feature-set was implemented\nwhen there was a need and the time for it. As a opensource library new features can be requested in the form of github issues\nor contributed using pull requests.\n\nLicense\n-------\n\nMIT\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Data science toolkit for the H3 geospatial grid",
"version": "0.21.1",
"project_urls": {
"Homepage": "https://github.com/nmandery/h3ronpy",
"Source Code": "https://github.com/nmandery/h3ronpy"
},
"split_keywords": [
"geo",
" spatial",
" h3",
" arrow",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "78ab95bf30c4afd08219c52a14ed77707f9c415540a9b7baf0dbcfda1e92760f",
"md5": "eac676450b8bfbed68e44863fe76cebe",
"sha256": "c0bc8b87da6de7f83c783581fae72a41af560bbb924b7f18c103fa9e73196781"
},
"downloads": -1,
"filename": "h3ronpy-0.21.1-cp38-abi3-macosx_10_14_x86_64.whl",
"has_sig": false,
"md5_digest": "eac676450b8bfbed68e44863fe76cebe",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 1801119,
"upload_time": "2024-10-04T19:01:39",
"upload_time_iso_8601": "2024-10-04T19:01:39.577943Z",
"url": "https://files.pythonhosted.org/packages/78/ab/95bf30c4afd08219c52a14ed77707f9c415540a9b7baf0dbcfda1e92760f/h3ronpy-0.21.1-cp38-abi3-macosx_10_14_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "955464151fef9d7e98c89c15289071322940e43c1cc4c35b6e3d8dfdf5654c4e",
"md5": "adef146719ef0275d0f81d178e1071e8",
"sha256": "6b3f15b86652c3fafdbaaaf977962317d7367176a1c1b13e688daff8c5e0c964"
},
"downloads": -1,
"filename": "h3ronpy-0.21.1-cp38-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "adef146719ef0275d0f81d178e1071e8",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 1723973,
"upload_time": "2024-10-04T19:01:42",
"upload_time_iso_8601": "2024-10-04T19:01:42.300303Z",
"url": "https://files.pythonhosted.org/packages/95/54/64151fef9d7e98c89c15289071322940e43c1cc4c35b6e3d8dfdf5654c4e/h3ronpy-0.21.1-cp38-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a4f377b490da2aa9b52a16bbfa325ef1eb0c344d134a61d3fc7727575e88a3ce",
"md5": "38d9d863463fe824570b6a04b87d9a08",
"sha256": "109c2424685096354c1390cec3842b65ea9fe8b4afb956ce918b604b7a68ad6b"
},
"downloads": -1,
"filename": "h3ronpy-0.21.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "38d9d863463fe824570b6a04b87d9a08",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 1893805,
"upload_time": "2024-10-04T19:01:45",
"upload_time_iso_8601": "2024-10-04T19:01:45.567734Z",
"url": "https://files.pythonhosted.org/packages/a4/f3/77b490da2aa9b52a16bbfa325ef1eb0c344d134a61d3fc7727575e88a3ce/h3ronpy-0.21.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9e94da2698b54083c8062c25d12c38d0ab304e825ac3dec4cac7f5297c60968b",
"md5": "8249d6e8885d20f4417edf70aba5d13d",
"sha256": "f69297204daf93875882692ff0c6cd253de0da5f94835598a54d01abb5be740b"
},
"downloads": -1,
"filename": "h3ronpy-0.21.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "8249d6e8885d20f4417edf70aba5d13d",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 2020641,
"upload_time": "2024-10-04T19:01:48",
"upload_time_iso_8601": "2024-10-04T19:01:48.189264Z",
"url": "https://files.pythonhosted.org/packages/9e/94/da2698b54083c8062c25d12c38d0ab304e825ac3dec4cac7f5297c60968b/h3ronpy-0.21.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "04c9799c0948c77ab5f8b1c1893109bc8e1f1f8e00795c84c0b66cb1e2f0bae9",
"md5": "1e38315ab15910e65348c9b1bb3043a9",
"sha256": "613bdee812ca31d27f2750ef0d453a6257461465adc4bd891a43db70226ad6be"
},
"downloads": -1,
"filename": "h3ronpy-0.21.1-cp38-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "1e38315ab15910e65348c9b1bb3043a9",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 1806024,
"upload_time": "2024-10-04T19:01:50",
"upload_time_iso_8601": "2024-10-04T19:01:50.882000Z",
"url": "https://files.pythonhosted.org/packages/04/c9/799c0948c77ab5f8b1c1893109bc8e1f1f8e00795c84c0b66cb1e2f0bae9/h3ronpy-0.21.1-cp38-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-04 19:01:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nmandery",
"github_project": "h3ronpy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "h3ronpy"
}