skillfed

pybcj

bcj filter library

pybcj v1.0.8 9.3M downloads/30d#1,550 on PyPI4
Copyleft license LGPL-2.1-or-later Active released

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 pybcj

uv

uv add pybcj

poetry

poetry add pybcj

Installing 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

Development Status :: 5 - Production/StableOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Tags

bcj filter pythonexecutable compression preprocessinglzma binary filterbranch call jump filter7zip bcj bindingsmachine code compressionx86 arm compression filter
compressionbinary-filterlzma

More Python Modules packages