{"id":24634459,"url":"https://github.com/erikbrinkman/hilbert-bytes","last_synced_at":"2025-05-08T20:54:04.666Z","repository":{"id":273151746,"uuid":"918469093","full_name":"erikbrinkman/hilbert-bytes","owner":"erikbrinkman","description":"A python library for converting between d-dimensional points and indices on a hilbert curve","archived":false,"fork":false,"pushed_at":"2025-04-06T16:42:53.000Z","size":137,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T00:51:15.448Z","etag":null,"topics":["hilbert-curve","numba","numpy","python"],"latest_commit_sha":null,"homepage":"https://erikbrinkman.github.io/hilbert-bytes/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erikbrinkman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-18T02:32:06.000Z","updated_at":"2025-04-06T16:42:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"4bd8019d-00b8-43e2-9b2b-57dba79ba55f","html_url":"https://github.com/erikbrinkman/hilbert-bytes","commit_stats":null,"previous_names":["erikbrinkman/hilbert-bytes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikbrinkman%2Fhilbert-bytes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikbrinkman%2Fhilbert-bytes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikbrinkman%2Fhilbert-bytes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikbrinkman%2Fhilbert-bytes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erikbrinkman","download_url":"https://codeload.github.com/erikbrinkman/hilbert-bytes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253149380,"owners_count":21861717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hilbert-curve","numba","numpy","python"],"created_at":"2025-01-25T09:12:49.183Z","updated_at":"2025-05-08T20:54:04.661Z","avatar_url":"https://github.com/erikbrinkman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hilbert Bytes\n\n[![build](https://github.com/erikbrinkman/hilbert-bytes/actions/workflows/python-package.yml/badge.svg)](https://github.com/erikbrinkman/hilbert-bytes/actions/workflows/python-package.yml)\n[![pypi](https://img.shields.io/pypi/v/hilbert-bytes)](https://pypi.org/project/hilbert-bytes/)\n[![docs](https://img.shields.io/badge/api-docs-blue)](https://erikbrinkman.github.io/hilbert-bytes)\n\nHilbert Bytes is a python library for converting to and from points in\nd-dimensions and their corresponding index on a hilbert curve. It's similar to\n[hilbertcurve](https://pypi.org/project/hilbertcurve/) and\n[numpy-hilbert-curve](https://pypi.org/project/numpy-hilbert-curve/) but is\nfaster and more space efficient than either by keeping manipulations at the byte\nlevel, and using numba to compile the results. It also uses arbitrary precision\nintegers, allowing you to make the grid arbitrarily fine\n\n## Installation\n\n```sh\npip install hilbert-bytes\n```\n\n## Usage\n\n```py\nimport hilbert_bytes\nimport numpy as np\n\npoints = ... # arbitrary d-dimensional points\nnum, dim = points.shape\n# convert to big-endian bytes\npoints_bytes = points[..., None].astype(\"\u003eu8\").view(\"u1\")\nindex_bytes = hilbert_bytes.encode(points_bytes)  # indies as big-endian ints\nnew_points_bytes = hilbert_bytes.decode(index_bytes)\n```\n\nIf you want the indices as multi-byte ints, you can can do a similar trick in reverse:\n\n```py\nindex_bytes = ... # an array of big-endian ints\nindices = index_bytes.view(\"\u003eu8\").astype(\"u8\")[..., 0]\n```\n\nBut note that this will only work if your index fits in 8 bytes\n\n## Publishing\n\n```sh\nrm -rf dist\nuv build\nuv publish --username __token__\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikbrinkman%2Fhilbert-bytes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferikbrinkman%2Fhilbert-bytes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikbrinkman%2Fhilbert-bytes/lists"}