pybcj
bcj filter library
What it is and what it does
pybcj is a Python binding to a C implementation of the BCJ (Branch-Call-Jump) filter, a preprocessing technique used in data compression to improve compression ratios for executable binaries. The filter works by replacing relative branch addresses with absolute ones, allowing downstream LZMA compressors to identify and deduplicate targets more effectively. The underlying C code is derived from p7zip, the portable 7-zip implementation, and supports multiple processor architectures including Intel/AMD x86/x86_64, Arm/Arm64, ArmThumb, Sparc, PPC, and IA64.
The package is built as a compiled extension with prebuilt wheels for modern Python versions (3.10–3.14) across major platforms. It has no runtime dependencies and is classified as Beta in development status, though the PyPI classifier indicates Production/Stable. It is actively maintained, with the latest release 29 days old and the repository not archived.
Use it for:
- Preprocessing executable binaries before LZMA compression to achieve higher compression ratios, similar to 7-zip's default behavior
- Building compression utilities or libraries that need BCJ filtering for multiple CPU architectures
- Integrating BCJ preprocessing into data archival or backup tools that target executable files
- Cross-platform binary optimization where compression size matters (embedded systems, distribution packages)
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pybcj provides Python bindings to a BCJ (Branch-Call-Jump) filter implementation for preprocessing executable binaries before compression, improving compression ratios when used with LZMA compressors.
Yes, if you need BCJ filtering for executable compression. The package is actively maintained, has no runtime dependencies, supports current Python versions, and offers prebuilt wheels for most platforms. The LGPL-2.1-or-later license requires review if you plan to distribute proprietary software. The medium install friction is typical for compiled extensions and should not be a barrier on standard platforms.
Install
pybcj on PyPI
pip
pip install pybcjuv
uv add pybcjpoetry
poetry add pybcjInstalling pybcj
Before you install
Medium install friction due to compiled C extensions; prebuilt wheels available for Python 3.10–3.14 on macOS, Linux (including musl), and Windows across multiple architectures. Last release 29 days ago; repository is active and not archived.
License in practice
Licensed under LGPL-2.1-or-later (copyleft). Derivative works and distributions must comply with copyleft obligations; proprietary or closed-source projects should review compatibility before use.
Quickstart
pip install pybcj
import pybcj
# pybcj provides BCJ filter functions for use with compression libraries
On MSYS2/Mingw64, set environment variable SETUPTOOLS_USE_DISTUTILS=stdlib before installation. Requires Python 3.10 or later.
Verify before relying
- Specific API surface and available filter functions for each supported architecture (x86, x86_64, Arm, Arm64, ArmThumb, Sparc, PPC, IA64)
- Whether pybcj is intended as a standalone tool or primarily as a dependency for other compression libraries
- Performance characteristics and typical compression gains when used with LZMA
Package facts
| License | LGPL-2.1-or-later (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 29 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 9,283,758/month — #1,550 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pybcj-1.0.8-cp310-cp310-macosx_10_9_universal2.whl; pybcj-1.0.8-cp310-cp310-macosx_10_9_x86_64.whl; pybcj-1.0.8-cp310-cp310-macosx_11_0_arm64.whl; pybcj-1.0.8-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pybcj-1.0.8-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pybcj-1.0.8-cp310-cp310-musllinux_1_2_aarch64.whl; pybcj-1.0.8-cp310-cp310-musllinux_1_2_x86_64.whl; pybcj-1.0.8-cp310-cp310-win_amd64.whl; pybcj-1.0.8-cp310-cp310-win_arm64.whl; pybcj-1.0.8-cp311-cp311-macosx_10_9_universal2.whl; pybcj-1.0.8-cp311-cp311-macosx_10_9_x86_64.whl; pybcj-1.0.8-cp311-cp311-macosx_11_0_arm64.whl; pybcj-1.0.8-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pybcj-1.0.8-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pybcj-1.0.8-cp311-cp311-musllinux_1_2_aarch64.whl; pybcj-1.0.8-cp311-cp311-musllinux_1_2_x86_64.whl; pybcj-1.0.8-cp311-cp311-win_amd64.whl; pybcj-1.0.8-cp311-cp311-win_arm64.whl; pybcj-1.0.8-cp312-cp312-macosx_10_13_universal2.whl; pybcj-1.0.8-cp312-cp312-macosx_10_13_x86_64.whl
Keywords: lzma, bcj
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pyzstdProvides Python bindings to the Zstandard…
permissive · top 5,000 on PyPI
lz4Python bindings for the LZ4 compression…
permissive · top 1,000 on PyPI
zstdProvides Python bindings to the Zstandard…
permissive · top 5,000 on PyPI
compress-pickleWraps Python's standard pickle serialization…
permissive · top 15,000 on PyPI
pyppmdCompresses and decompresses data using the PPMd…
copyleft · top 5,000 on PyPI
lzfsePython bindings for the LZFSE reference…
permissive · top 5,000 on PyPI
py7zrpy7zr is a pure-Python library for reading,…
copyleft · top 5,000 on PyPI
brotlicffiProvides Python CFFI bindings to the Brotli…
permissive · top 5,000 on PyPI
astc-encoder-pyastc-encoder-py compresses and decompresses…
permissive · top 15,000 on PyPI