{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/3"}],"enrichment":{"capability":"Packs and unpacks Python values into bit-level binary structures, similar to the struct module but operating on individual bits rather than bytes.","skillfed_tags":["binary-serialization","bit-manipulation","protocol-parsing"],"use_cases":["Parse binary network protocols or file formats with non-byte-aligned fields (e.g., bit flags, variable-width integers)","Serialize structured data into compact binary representations for embedded systems or bandwidth-constrained communication","Extract and manipulate individual bit fields from hardware register dumps or low-level binary data","Implement bit-level codecs for compression or encoding schemes that operate below byte boundaries","Test and validate binary protocol implementations by packing/unpacking known test vectors"],"what_it_does":"Bitstruct converts between Python values and bit-level binary structures, extending the interface of Python's built-in struct module to work on individual bits instead of bytes. It provides functions to pack values into compact binary representations and unpack them back, with support for unsigned integers, signed integers, floats, booleans, raw bytes, and text strings at arbitrary bit boundaries.\n\nFormat strings specify bit widths and types (e.g., 'u1u3u4s16' for a 1-bit unsigned, 3-bit unsigned, 4-bit unsigned, and 16-bit signed integer), and compiled format objects allow reuse of the same specification across multiple operations. It supports bit-offset packing into existing buffers, dictionary-based packing/unpacking, and byte-order control. The library includes both a pure Python implementation and optional C accelerations for faster pack/unpack operations on CPython 3.","worth_installing":"Yes, if you need to work with bit-level binary data. Bitstruct is stable (Production/Stable status), actively maintained, has no dependencies, and provides a clear interface for a specialized but real problem. The optional C acceleration and wide platform support make it practical for both development and performance-critical code. No security vulnerabilities reported."},"id":"bitstruct","links":{"html":"https://skillfed.io/packages/bitstruct","md":"https://skillfed.io/packages/bitstruct.md","pypi":"https://pypi.org/project/bitstruct/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-02-17","license_spdx":"MIT","license_treatment":"permissive","name":"bitstruct","python_support":"supports_current","summary":"This module performs conversions between Python values and C bit field structs represented as Python byte strings."},"popularity":{"monthly_downloads":5110055,"position":2167,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"8.22.1"}
