--- id: intbitset version: "4.1.2" license: LGPL-3.0-or-later license_treatment: copyleft maintenance: active --- # intbitset — C-based extension implementing fast integer bit sets. License: copyleft · Maintenance: active · Downloads: 136.1K/mo ## 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 above — 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 pip install intbitset uv add intbitset poetry add intbitset ## Installing 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: unspecified - Install friction: medium - Maintenance: active - Downloads: 136.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags fast integer set operations, bit vector set implementation, dense integer storage, optimized set data structure, memory-efficient integer sets, bitset library python, high-performance set operations, data-structures, performance-critical, c-extension [View on SkillFed](https://skillfed.io/packages/intbitset) · [View on PyPI](https://pypi.org/project/intbitset/)