$npx skillfedfor your agent

cbitstruct

Faster C implementation of bitstruct

With conditionsPyPI Software DevelopmentReleased Feb 2026223.4K downloads / moMPL-2.0Platform wheel

Decision gist · record as of 2026-08-14

platform wheels — cbitstruct-1.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl · cbitstruct-1.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl · cbitstruct-1.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
v1.2.0 · released 2026-02-09 · Python >=3.8

Yes, if you are already using bitstruct and have identified bit packing/unpacking as a bottleneck in a CPython application on x86_64 Linux. The performance gains are substantial, and the API compatibility makes migration straightforward. No, if you need portability to other architectures, big-endian systems, or non-CPython implementations, or if you require clear error messages and full bitstruct feature parity. The copyleft license (MPL-2.0) also requires careful review if you plan to distribute derived works.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires CPython 3.8 or later; C extension wheels are available only for x86_64 Linux (manylinux2014 and later); other platforms or architectures require compilation from source.
  • Medium install friction due to compiled C extension wheels; prebuilt binaries are available for Python 3.8–3.14 on x86_64 Linux, but the package is aging (last release 186 days ago) with modest maintenance activity.

License · maintenance · safety

MPL-2.0 (copyleft) — Licensed under MPL-2.0 (copyleft); derivative works and modifications must be distributed under the same license, which may restrict commercial or proprietary use without disclosure.

last release 2026-02-09 (186 days) · last repo commit 2026-02-09 · 25 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 223,422 downloads/mo, #9,245 on PyPI

Verify before relying

pip install cbitstruct

import cbitstruct

# Pack integers into bits
packed = cbitstruct.pack('u8', 1)

# Unpack bits back to integers
unpacked = cbitstruct.unpack('u8', packed)
  • Whether the performance gains reported in the test suite (ranging from 8× to 139× faster) hold for real-world workloads outside the benchmark.
  • Whether the 64-bit field limit and potential big-endian architecture issues affect your use case.
  • Current maintenance trajectory and whether limitations listed as 'Maybe' or 'Probably not' are likely to be addressed.
Same gist for agents: .md · .json

What it is and what it does

cbitstruct is a C-based reimplementation of the bitstruct library, designed to parse and serialize binary data (bit fields, packed structs, protocol messages) much faster than the pure-Python version. It provides the same API—pack, unpack, pack_into, unpack_from, and compiled format objects—so you can often swap it in as a drop-in replacement by changing the import statement.

The tradeoff is that cbitstruct has real limitations: fields are capped at 64 bits (except padding), it only runs on CPython, error messages are less helpful, and it may not work on big-endian systems. The description notes that exceptions differ from bitstruct and some limitations are unlikely to be lifted. It's best suited for performance-critical code paths where you're already familiar with bitstruct and need the speed boost.

Use it for

  • Parsing binary network protocols or packet formats where speed matters and fields fit within 64 bits.
  • Serializing structured data into compact binary form for storage or transmission in latency-sensitive applications.
  • Unpacking embedded device telemetry or sensor data streams with high throughput requirements.
  • Building compiled format objects for repeated pack/unpack cycles in tight loops.
  • Migrating performance-critical bitstruct code to C acceleration without rewriting the logic.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are already using bitstruct and have identified bit packing/unpacking as a bottleneck in a CPython application on x86_64 Linux.

The performance gains are substantial, and the API compatibility makes migration straightforward. No, if you need portability to other architectures, big-endian systems, or non-CPython implementations, or if you require clear error messages and full bitstruct feature parity. The copyleft license (MPL-2.0) also requires careful review if you plan to distribute derived works.

Install

cbitstruct on PyPI

Before you install

Medium install friction due to compiled C extension wheels; prebuilt binaries are available for Python 3.8–3.14 on x86_64 Linux, but the package is aging (last release 186 days ago) with modest maintenance activity.

Requires CPython 3.8 or later; C extension wheels are available only for x86_64 Linux (manylinux2014 and later); other platforms or architectures require compilation from source.

License in practice

Licensed under MPL-2.0 (copyleft); derivative works and modifications must be distributed under the same license, which may restrict commercial or proprietary use without disclosure.

Quickstart

pip install cbitstruct

import cbitstruct

# Pack integers into bits
packed = cbitstruct.pack('u8', 1)

# Unpack bits back to integers
unpacked = cbitstruct.unpack('u8', packed)

Verify before relying

  • Whether the performance gains reported in the test suite (ranging from 8× to 139× faster) hold for real-world workloads outside the benchmark.
  • Whether the 64-bit field limit and potential big-endian architecture issues affect your use case.
  • Current maintenance trajectory and whether limitations listed as 'Maybe' or 'Probably not' are likely to be addressed.

Package facts

LicenseMPL-2.0 copyleft
Python supportSupports the current Python release >=3.8
Install frictionMedium. Platform-specific wheel
Runtime dependenciesNone
MaintenanceAging 186 days since the last release
Last repo commit
First released
Downloads223,422 / month, #9,245 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Operating System :: OS IndependentProgramming Language :: CProgramming Language :: Python :: 3

Evidence: cbitstruct-1.2.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cbitstruct-1.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cbitstruct-1.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cbitstruct-1.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cbitstruct-1.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cbitstruct-1.2.0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; cbitstruct-1.2.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Tags

Capabilities
bit packing unpackingbinary data serializationbitfield parsingstruct packing performanceC accelerated bitstructfast bit manipulationbinary protocol parsing
Topics
binary-serializationperformance-criticalc-extension
PyPI keywords
bitpackunpackstructbitfieldbit parsingbit unpackbit packC

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “struct packing performance”

  • cbitstructA C-accelerated implementation of the bitstruct library that packs…
  • bitstructPacks and unpacks Python values into bit-level binary structures,…
  • plum-pyTransforms byte sequences into Python objects and back using…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also bitstruct · plum-py · bitstring · pycstruct · dissect.cstruct · tibs · msgpack · bitarray · fdt · PyByteBuffer