Install & Compatibility
Where this runs
tested against v0.11.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.198s · 160.7MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 17.2s · import 0.168s · 157MB
168MB installed
● package 168MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
refinery
✓ import refinery
✗ import binary_refinery
The package installs as 'binary-refinery' but the module is 'refinery'. Common mistake.
refinery.units
✓ from refinery import units
✗ from refinery.units import ...
Top-level import of units works; deeper paths may not be importable directly.
Basic pipeline: pipe binary data through refinery units using the | operator.
import os
import json
from refinery import units
# Process a binary payload: base64 decode, decompress, and display hex
payload = b'JVBERi0xLjQ...' # truncated for example
result = payload | units.b64() | units.zlib() | units.hexview()
print(result)
# Use a variable for conditional branching (requires 'refinery.lib')
from refinery.lib import argformats
print(argformats), # just to demonstrate import is available
refinery --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'binary_refinery'
Wrong import name; the Python package installs as 'binary-refinery' but the module is 'refinery'.
fixpip install binary-refinery; then use 'import refinery'.
AttributeError: module 'refinery' has no attribute 'b64'
Units are not available as attributes on the top-level module; must import 'units' submodule.
fixfrom refinery import units; units.b64()
TypeError: 'NoneType' object is not callable
Forgetting to instantiate a unit class (missing parentheses).
fixdata | units.b64() # with parentheses
Upgrade
Version history
0.11.1latest on PyPI · released May 28, 2026
Audit
Dependencies
capstoneoptionalDisassembly support for x86, x64, ARM, etc.
yara-pythonoptionalYARA pattern matching