intbitset
C-based extension implementing fast integer bit sets.
What it is and what it does
intbitset is a C-based Python extension that implements a set class for storing sorted unsigned integers using bit vectors. It emulates the Python built-in set interface—supporting union, intersection, difference, and standard set operations—while delivering faster performance and lower memory usage for dense integer collections. The library supports pickling, iteration, slicing, and fast min/max access since integers are always stored sorted.
You would use intbitset when you need to perform repeated set operations on large collections of integers and performance or memory efficiency matters. It trades the flexibility of storing arbitrary Python objects (which the standard set does) for speed and compactness when your data is integers. The package has no runtime dependencies and is actively maintained; wheels are available for modern Python versions and common platforms, though building from source requires a C compiler.
Use it for:
- Filtering and intersecting large integer collections in data processing pipelines where speed is critical.
- Storing and querying membership in dense integer ranges (e.g., document IDs, user IDs) in search or database systems.
- Performing fast set algebra (union, difference) on integer sequences in scientific or statistical computations.
- Building inverted indexes or bit-level data structures where integer set operations are the core operation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
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.
Yes, if you work with dense integer sets and need fast set operations. The package is actively maintained, has no dependencies, and offers pre-built wheels for common platforms. The copyleft license (LGPL-3.0-or-later) requires derivative works to use the same license, so review compliance before use in proprietary code. No known vulnerabilities.
Install
intbitset on PyPI
pip
pip install intbitsetuv
uv add intbitsetpoetry
poetry add intbitsetInstalling intbitset
Before you install
Wheels are pre-built for common platforms and Python versions, reducing installation friction. The package is actively maintained with a recent release and no runtime dependencies, though building from source requires a C compiler.
License in practice
intbitset is licensed under LGPL-3.0-or-later (copyleft). Derivative works and modifications must be distributed under the same or compatible license; proprietary closed-source applications using this library must comply with copyleft obligations or obtain a commercial license.
Quickstart
pip install intbitset
from intbitset import intbitset
x = intbitset([1, 2, 3])
y = intbitset([3, 4, 5])
result = x & y # intersection
print(result) # intbitset([3])
Building from source requires a C compiler; pre-built wheels are available for most common platforms and Python versions.
Verify before relying
- Whether the performance advantage applies to your specific use case (dense vs. sparse sets, set size, operation patterns).
- Exact memory overhead compared to standard set for your typical integer ranges and densities.
- Support for Python versions beyond 3.10–3.12.
Package facts
| License | LGPL-3.0-or-later (copyleft) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 108 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 136,067/month — #11,407 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: intbitset-4.1.2-cp310-cp310-macosx_10_9_universal2.whl; intbitset-4.1.2-cp310-cp310-macosx_11_0_arm64.whl; intbitset-4.1.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; intbitset-4.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; intbitset-4.1.2-cp310-cp310-musllinux_1_2_aarch64.whl; intbitset-4.1.2-cp310-cp310-musllinux_1_2_x86_64.whl; intbitset-4.1.2-cp310-cp310-win_amd64.whl; intbitset-4.1.2-cp311-cp311-macosx_10_9_universal2.whl; intbitset-4.1.2-cp311-cp311-macosx_11_0_arm64.whl; intbitset-4.1.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; intbitset-4.1.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; intbitset-4.1.2-cp311-cp311-musllinux_1_2_aarch64.whl; intbitset-4.1.2-cp311-cp311-musllinux_1_2_x86_64.whl; intbitset-4.1.2-cp311-cp311-win_amd64.whl; intbitset-4.1.2-cp312-cp312-macosx_10_13_universal2.whl; intbitset-4.1.2-cp312-cp312-macosx_11_0_arm64.whl; intbitset-4.1.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; intbitset-4.1.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; intbitset-4.1.2-cp312-cp312-musllinux_1_2_aarch64.whl; intbitset-4.1.2-cp312-cp312-musllinux_1_2_x86_64.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
fixedintProvides fixed-width integer classes that…
permissive · top 5,000 on PyPI
cpuset-py3Wraps Linux cpuset kernel facilities through…
unclear · top 15,000 on PyPI
pyroaringProvides an efficient, ordered set data…
permissive · top 1,000 on PyPI
HLLEstimates the cardinality (unique count) of…
permissive · top 15,000 on PyPI
bitarrayProvides an efficient C-backed array type for…
permissive · top 1,000 on PyPI
bitarray-hardbyteProvides an efficient C-backed array type for…
permissive · top 15,000 on PyPI
marisa-trieProvides memory-efficient trie data structures…
copyleft · top 5,000 on PyPI
multisetProvides a mutable and immutable multiset data…
permissive · top 15,000 on PyPI
cintWraps ctypes integer types to perform…
permissive · top 5,000 on PyPI
python-flintPython bindings for FLINT and Arb that provide…
copyleft · top 15,000 on PyPI