Skip to main content

Deserialize 64 bit roaring bitmaps into a Python set of integers. roroaring64 is a lightweight Python binding on top of the CRoaring library.

Note: roroaring64 has only been testing on Linux, so OSX and Windows users, your mileage may vary.

Motivation

brotchie@ built this library to deserialized the 64 bit roaring bitmaps turbo-geth uses in its database model.

API

The roroaring64 module exposes a single method:

def deserialize(serialized: bytes) -> Set[int]:
    ...

deserialize takes the byte representation of a 64 bit roaring bitmap serialized from the Go, Java, or C++ reference roaring bitmap implementations. It returns a Python set of all 64 bit integers contained within the input bitmap.

Example Usage

>>> import roroaring64
>>> hex_bitmap = "0100000000000000000000003a300000010000004700040010000000e64ee84ee94eea4eeb4e"
>>> values = roroaring64.deserialize(bytes.fromhex(hex_bitmap))
>>> print(values)
{4673254, 4673256, 4673257, 4673258, 4673259}

Installation

$ pip install roroaring64

Tests

$ python test.py

Manual Compilation

$ python setup.py build_ext -i

Credits

Thanks to the authors of CRoaring and to ezibenroc@, the author of PyRoaringBitmap, whose project I looked at to work out Cython packaging.

License

MIT License

Release files for roroaring64 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for roroaring64 0.1.0
File Size Uploaded
roroaring64-0.1.0.tar.gz 157.7 kB Details

Release files / roroaring64-0.1.0.tar.gz

Download URL roroaring64-0.1.0.tar.gz
Size 157.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8ba42f5c80cb72b4c778aa01bbcfda03195bc340301362df40f97b7e204a53c9
BLAKE2b-256 checksum
How to use checksums
ab5fd76f472febca9479ac1d25f935b0d34e3ba45dfc8e0c23a1f137145c38f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page