--- id: bitarray-hardbyte version: "2.3.8" license: PSF license_treatment: permissive maintenance: active --- # bitarray-hardbyte — efficient arrays of booleans -- C extension License: permissive · Maintenance: active · Downloads: 93.8K/mo ## What it is and what it does bitarray-hardbyte is a C extension that provides a memory-efficient array type for storing boolean values. Eight bits are packed into a single byte, making it far more compact than a Python list of booleans. The library supports both big-endian and little-endian bit ordering, allowing fine-grained control over how bits map to bytes—important when working with binary protocols, file formats, or memory-mapped data. The package behaves like a standard Python sequence: you can slice, extend, iterate, and apply bitwise operations (&, |, ^, ~, <<, >>) directly on bitarray objects. It includes utility functions for encoding/decoding variable-length prefix codes, converting to hexadecimal, creating Huffman codes, and serialization. All functionality is implemented in C for speed, and the library supports the buffer protocol for zero-copy interoperability with other binary data structures like numpy arrays. Use it for: - Storing large sets of boolean flags or bit masks where memory efficiency is critical. - Implementing Bloom filters, bitmaps, or other bit-level data structures. - Working with binary file formats or network protocols that require precise bit-level manipulation. - Creating Huffman codes or other variable-length prefix codes for compression. - Interfacing with memory-mapped files or C libraries that expect raw bit-level data. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides an efficient C-backed array type for storing and manipulating sequences of boolean values, with support for bitwise operations, slicing, and endianness control. Yes, if you need memory-efficient boolean storage or bit-level operations. The package is mature, actively maintained, permissively licensed, and has no known vulnerabilities. Install friction is moderate due to C compilation, but precompiled wheels cover most common platforms. Not necessary for typical Python applications that don't require bit-level manipulation or extreme memory optimization. ## Install pip install bitarray-hardbyte uv add bitarray-hardbyte poetry add bitarray-hardbyte ## Installing bitarray-hardbyte Before you install: Medium install friction due to C compilation requirement, but precompiled wheels are available for common platforms (macOS, Linux, Windows, multiple architectures). Maintenance is active with recent commits and a stable release history since 2019. License in practice: Licensed under the Python Software Foundation License (PSF), a permissive license that allows commercial and private use with minimal restrictions. Quickstart: pip install bitarray-hardbyte from bitarray import bitarray a = bitarray() a.append(1) a.extend([1, 0]) print(a) # bitarray('110') print(a.count(1)) # 2 Requires a C compiler if installing from source; precompiled wheels available for Python 3.6–3.10 on macOS, Linux (x86_64, i686), and Windows. Verify before relying: - Whether bitarray-hardbyte is a maintained fork or variant of the original bitarray package and how it differs functionally. - Current Python 3.11+ support status, given that friction evidence shows wheels only up to cp310. ## Package facts - License: PSF (permissive) - Python support: unspecified - Install friction: medium - Maintenance: active - Downloads: 93.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags boolean array library, bit manipulation in python, efficient bitarray implementation, bitwise operations library, memory-efficient boolean storage, bit-manipulation, c-extension, memory-efficient [View on SkillFed](https://skillfed.io/packages/bitarray-hardbyte) · [View on PyPI](https://pypi.org/project/bitarray-hardbyte/)