--- id: bitarray version: "3.10.1" license: PSF-2.0 license_treatment: permissive maintenance: active --- # bitarray — efficient arrays of booleans -- C extension License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install bitarray uv add bitarray poetry add bitarray ## Description bitarray: efficient arrays of booleans ====================================== This library provides an object type which efficiently represents an array of booleans. Bitarrays are sequence types and behave very much like usual lists. Eight bits are represented by one byte in a contiguous block of memory. The user can select between two representations: little-endian and big-endian. All functionality is implemented in C. Methods for accessing the machine representation are provided, including the ability to import and export buffers. This allows creating bitarrays that are mapped to other objects, including memory-mapped files. Key features ------------ * The bit-endianness can be specified for each bitarray object, see below. * Sequence methods: slicing (including slice assignment and deletion), operations ``+``, ``*``, ``+=``, ``*=``, the ``in`` operator, ``len()`` * Bitwise operations: ``~``, ``&``, ``|``, ``^``, ``<<``, ``>>`` (as well as their in-place versions ``&=``, ``|=``, ``^=``, ``<<=``, ``>>=``). * Free-threading support (for GIL disabled CPython 3.14 and later) * Fast methods for encoding and decoding variable bit length prefix codes. * Bitarray objects... ## AI interpretation — verify before relying bitarray provides an efficient, memory-compact array type for storing sequences of boolean values, with support for bitwise operations, slicing, and buffer protocol access—all implemented in C for performance. Verdict: bitarray is a mature, actively maintained library (first released 2008-08-17, latest release 2026-08-07) with zero known vulnerabilities and broad platform coverage. Its C implementation and permissive PSF-2.0 license make it a reliable choice for performance-critical boolean array operations. Install friction is moderate but manageable given comprehensive wheel availability. [View on SkillFed](https://skillfed.io/packages/bitarray) · [View on PyPI](https://pypi.org/project/bitarray/)