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/
.. image:: https://zenodo.org/badge/402118389.svg
:alt: DOI
:target: https://zenodo.org/badge/latestdoi/402118389
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": "",
"maintainer_email": null,
"keywords": "geo,spatial,h3,arrow,python",
"author": "Nico Mandery <nico@nmandery.net>",
"author_email": "Nico Mandery <nico@nmandery.net>",
"download_url": "https://files.pythonhosted.org/packages/ec/0a/755e4dc5d601e0e84ab6947fe090dcb7229d74243092406cfe27e1e06dec/h3ronpy-0.20.1.tar.gz",
"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.. image:: https://zenodo.org/badge/402118389.svg\n :alt: DOI\n :target: https://zenodo.org/badge/latestdoi/402118389\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",
"bugtrack_url": null,
"license": "MIT",
"summary": "Data science toolkit for the H3 geospatial grid",
"version": "0.20.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": "8c84dddb9b313b6df58d1c61f49f2267b65c6b2c7585115fe2c058ee2b1bb1e7",
"md5": "e1c0230283e69d84ed2067e14e6a386c",
"sha256": "1d3ed1e11d8f8627da4480f3e9a691f1131056faa5913024d0d04982370c93f0"
},
"downloads": -1,
"filename": "h3ronpy-0.20.1-cp38-abi3-macosx_10_14_x86_64.whl",
"has_sig": false,
"md5_digest": "e1c0230283e69d84ed2067e14e6a386c",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 1643543,
"upload_time": "2024-03-01T16:24:16",
"upload_time_iso_8601": "2024-03-01T16:24:16.550258Z",
"url": "https://files.pythonhosted.org/packages/8c/84/dddb9b313b6df58d1c61f49f2267b65c6b2c7585115fe2c058ee2b1bb1e7/h3ronpy-0.20.1-cp38-abi3-macosx_10_14_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "06bd1d4a1f2d041c502384e9f64c67bb89250c3fbaa401e3000af507ec88787b",
"md5": "919e0dad69ecaecdfe6917fe867e7686",
"sha256": "db98ffed225e5b595898a37ad49cdf7732a4d45486e7aba0b22c265f5ba21e5c"
},
"downloads": -1,
"filename": "h3ronpy-0.20.1-cp38-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "919e0dad69ecaecdfe6917fe867e7686",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 1551511,
"upload_time": "2024-03-01T16:24:18",
"upload_time_iso_8601": "2024-03-01T16:24:18.310798Z",
"url": "https://files.pythonhosted.org/packages/06/bd/1d4a1f2d041c502384e9f64c67bb89250c3fbaa401e3000af507ec88787b/h3ronpy-0.20.1-cp38-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "3791b690ac945c41ab43c1a24fd4c745d07539490b96b11d02bee53c3828e30b",
"md5": "8df356a494b1be27bd12952650ff8aa5",
"sha256": "055d4f500d70dcbde9599192f7fa4a0203d298c7f20ace9465ee89e22b1d01fd"
},
"downloads": -1,
"filename": "h3ronpy-0.20.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "8df356a494b1be27bd12952650ff8aa5",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 1652272,
"upload_time": "2024-03-01T16:24:19",
"upload_time_iso_8601": "2024-03-01T16:24:19.800721Z",
"url": "https://files.pythonhosted.org/packages/37/91/b690ac945c41ab43c1a24fd4c745d07539490b96b11d02bee53c3828e30b/h3ronpy-0.20.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "988461939dcd24f0daf5f6b5632c44afc1d140fc74126b6d1d3b70b3ff590820",
"md5": "2babd91a5504d96e3bc33f7767f872eb",
"sha256": "1b2b1b0db5047d051ee0ec95f89773c94543265e4a4cd6bfae0ceb875db8860d"
},
"downloads": -1,
"filename": "h3ronpy-0.20.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "2babd91a5504d96e3bc33f7767f872eb",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 1779432,
"upload_time": "2024-03-01T16:24:21",
"upload_time_iso_8601": "2024-03-01T16:24:21.237032Z",
"url": "https://files.pythonhosted.org/packages/98/84/61939dcd24f0daf5f6b5632c44afc1d140fc74126b6d1d3b70b3ff590820/h3ronpy-0.20.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9048b9e81c10dc6c1412e0dc05c03c4e8e835ded8344cfc8e66d1a7eb4b548dc",
"md5": "b9d3e4113123268ee40ead4602500283",
"sha256": "06039685f2961479568f702916a05394f6d2e558b8bc7de5123c9bd6576b92fc"
},
"downloads": -1,
"filename": "h3ronpy-0.20.1-cp38-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "b9d3e4113123268ee40ead4602500283",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 1634902,
"upload_time": "2024-03-01T16:24:23",
"upload_time_iso_8601": "2024-03-01T16:24:23.243815Z",
"url": "https://files.pythonhosted.org/packages/90/48/b9e81c10dc6c1412e0dc05c03c4e8e835ded8344cfc8e66d1a7eb4b548dc/h3ronpy-0.20.1-cp38-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ec0a755e4dc5d601e0e84ab6947fe090dcb7229d74243092406cfe27e1e06dec",
"md5": "f8a1e66c034b6ccb4a9bd0d87b4322f6",
"sha256": "deb12cf1fe0f771f4315c3864666190e8a76fc93b8e5220cef53501a5590e69c"
},
"downloads": -1,
"filename": "h3ronpy-0.20.1.tar.gz",
"has_sig": false,
"md5_digest": "f8a1e66c034b6ccb4a9bd0d87b4322f6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 726274,
"upload_time": "2024-03-01T16:24:24",
"upload_time_iso_8601": "2024-03-01T16:24:24.754331Z",
"url": "https://files.pythonhosted.org/packages/ec/0a/755e4dc5d601e0e84ab6947fe090dcb7229d74243092406cfe27e1e06dec/h3ronpy-0.20.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-01 16:24:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "nmandery",
"github_project": "h3ronpy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "h3ronpy"
}