--- id: pyroaring version: "1.1.0" license: MIT license_treatment: permissive maintenance: active --- # pyroaring — Library for handling efficiently sorted integer sets. License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install pyroaring uv add pyroaring poetry add pyroaring ## Description |Documentation Status| An efficient and light-weight ordered set of integers. This is a Python wrapper for the C library `CRoaring `__. Example ------- You can use a bitmap nearly as the classical Python set in your code: .. code:: python from pyroaring import BitMap bm1 = BitMap() bm1.add(3) bm1.add(18) print("has 3:", 3 in bm1) print("has 4:", 4 in bm1) bm2 = BitMap([3, 27, 42]) print("bm1 = %s" % bm1) print("bm2 = %s" % bm2) print("bm1 & bm2 = %s" % (bm1&bm2)) print("bm1 | bm2 = %s" % (bm1|bm2)) Output: :: has 3: True has 4: False bm1 = BitMap([3, 18]) bm2 = BitMap([3, 27, 42]) bm1 & bm2 = BitMap([3]) bm1 | bm2 = BitMap([3, 18, 27, 42]) The class ``BitMap`` is for 32 bit integers, it supports values from 0 to 2**32-1 (included). For larger numbers, you can use the class ``BitMap64`` that supports values from 0 to 2**64-1 (included). Installation from Pypi with pip ------------------------------- Supported systems: Linux, MacOS or Windows, Python 3.9 or higher. Note that pyroaring might still work with older Python versions, but... ## AI interpretation — verify before relying Provides an efficient, ordered set data structure for 32-bit and 64-bit integers using a Python wrapper around the C library CRoaring, supporting set operations like union, intersection, and membership testing. Verdict: A well-maintained, actively developed library offering significant performance advantages for integer set operations over Python's built-in set. No known vulnerabilities, permissive MIT license, and broad platform/Python version support make it a low-risk choice for applications requiring efficient integer collections. [View on SkillFed](https://skillfed.io/packages/pyroaring) · [View on PyPI](https://pypi.org/project/pyroaring/)