pyroaring
Library for handling efficiently sorted integer sets.
Decision gist · record as of 2026-08-14
Yes, if you work with large integer collections and need faster set operations or lower memory usage than Python's built-in set. The prebuilt wheels eliminate compilation friction on common platforms. No, if your integer sets are small or you prioritize API simplicity over performance—the standard set is simpler and sufficient for most use cases.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a C compiler if building from source; prebuilt wheels eliminate this for standard platforms.
- Medium install friction due to compiled C extension; however, prebuilt wheels are available for Python 3.9–3.14 across Linux, macOS, and Windows, making installation straightforward on supported platforms.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing use in commercial and proprietary projects with minimal restrictions.
last release 2026-04-24 (112 days) · last repo commit 2026-05-06 · 234 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 39,262,205 downloads/mo, #699 on PyPI
Alternatives
Verify before relying
pip install pyroaring
from pyroaring import BitMap
bm = BitMap([3, 18, 27])
print(3 in bm) # True
print(bm & BitMap([3, 42])) # BitMap([3])- Whether performance gains over built-in set justify the dependency in typical workloads
- Memory overhead comparison with native Python sets for small collections
What it is and what it does
Pyroaring is a Python wrapper around the CRoaring C library that implements compressed bitmap data structures for efficient integer set operations. It provides two main classes: BitMap for 32-bit integers (0 to 2^32-1) and BitMap64 for 64-bit integers (0 to 2^64-1). The package trades some API familiarity for speed and memory efficiency, supporting standard set operations like union, intersection, and membership testing.
The library is designed for scenarios where you need to store and manipulate large collections of integers with minimal memory footprint and fast operations. It has no runtime dependencies beyond the compiled C extension, making it lightweight to include in projects. The package is actively maintained, supports modern Python versions (3.9–3.14), and runs on Linux, macOS, and Windows.
Use it for
- Storing and querying large sets of user IDs or entity identifiers in memory-constrained environments
- Performing fast set operations (union, intersection, difference) on integer collections in data processing pipelines
- Building inverted indexes or bitmap-based filters in search or analytics systems
- Implementing efficient range queries or membership tests on integer ranges in databases or caches
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with large integer collections and need faster set operations or lower memory usage than Python's built-in set.
The prebuilt wheels eliminate compilation friction on common platforms. No, if your integer sets are small or you prioritize API simplicity over performance—the standard set is simpler and sufficient for most use cases.
Install
pyroaring on PyPI
Before you install
Medium install friction due to compiled C extension; however, prebuilt wheels are available for Python 3.9–3.14 across Linux, macOS, and Windows, making installation straightforward on supported platforms.
Requires a C compiler if building from source; prebuilt wheels eliminate this for standard platforms.
License in practice
MIT license is permissive, allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install pyroaring
from pyroaring import BitMap
bm = BitMap([3, 18, 27])
print(3 in bm) # True
print(bm & BitMap([3, 42])) # BitMap([3])
Verify before relying
- Whether performance gains over built-in set justify the dependency in typical workloads
- Memory overhead comparison with native Python sets for small collections
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 112 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 39,262,205 / month, #699 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9 |
Evidence: pyroaring-1.1.0-cp310-cp310-macosx_14_0_arm64.whl; pyroaring-1.1.0-cp310-cp310-macosx_14_0_universal2.whl; pyroaring-1.1.0-cp310-cp310-macosx_14_0_x86_64.whl; pyroaring-1.1.0-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pyroaring-1.1.0-cp310-cp310-manylinux_2_24_armv7l.manylinux_2_31_armv7l.whl; pyroaring-1.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; pyroaring-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl; pyroaring-1.1.0-cp310-cp310-musllinux_1_2_armv7l.whl; pyroaring-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl; pyroaring-1.1.0-cp310-cp310-win32.whl; pyroaring-1.1.0-cp310-cp310-win_amd64.whl; pyroaring-1.1.0-cp310-cp310-win_arm64.whl; pyroaring-1.1.0-cp311-cp311-macosx_14_0_arm64.whl; pyroaring-1.1.0-cp311-cp311-macosx_14_0_universal2.whl; pyroaring-1.1.0-cp311-cp311-macosx_14_0_x86_64.whl; pyroaring-1.1.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pyroaring-1.1.0-cp311-cp311-manylinux_2_24_armv7l.manylinux_2_31_armv7l.whl; pyroaring-1.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; pyroaring-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl; pyroaring-1.1.0-cp311-cp311-musllinux_1_2_armv7l.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “efficient integer set”
- pyroaringProvides an efficient, ordered set data structure for integers backed…
- intbitsetintbitset provides a fast, memory-efficient set implementation for…
- eth-bloomImplements Ethereum's bloom filter algorithm for efficient membership…
Give your agent the search over MCP, or paste the wish link into any chat.
Similar packages
BitMap provides a compact bit array class for storing and manipulating individual bits, with operations to set, reset, flip, test, and query bits.
intbitset provides a fast, memory-efficient set implementation for storing sorted unsigned integers using bit vectors, implemented as a Python C extension with set operations significantly faster than the standard library set for dense integer collections.
Provides fixed-width integer classes that preserve their bit width across arithmetic operations, with both mutable and immutable variants for emulating machine integers.
However, do not use it if you require active bug fixes or Python version support beyond what was tested at the last release in 2022.
Provides sorted list, dict, and set data structures implemented in pure Python with performance comparable to C extensions, requiring no compilation or external dependencies.
However, do not adopt it for new projects expecting ongoing maintenance or compatibility updates—use it only when the specific API and behavior are a strong fit and…
Provides specialized sorted collection data structures (dictionaries, sets, lists) that maintain order and support efficient indexed access and value-based sorting, built on top of sortedcontainers.
bitmath converts and performs arithmetic on file sizes across SI and NIST prefix units (kB to YiB), with support for human-readable formatting, rich comparisons, and capacity math.
See also xxhash · PyTrie · Bottleneck · graycode