Scan your whole stack
From OX Research Newsroom
Are you using compress-utils?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.12.2
compress-utils was last scanned on 24 Nov 2026 at version 0.12.2. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.12.2 LATEST | 23 Nov 2026 | No rules fired |
| 0.12.1 | 13 Nov 2026 | No rules fired |
| 0.12.0 | 30 Oct 2026 | No rules fired |
| 0.11.2 | 25 Oct 2026 | Not shown |
| 0.11.1 | 21 Oct 2026 | Not shown |
Findings for v0.12.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.12.2; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
One API for Zstandard, Brotli, zlib, gzip, bzip2, LZ4, XZ/LZMA and Snappy, plus raw DEFLATE, LZ4 blocks and LZO decoding, with performance on par with the dedicated Python packages for each format. Self-contained wheels with no system libraries, free-threaded Python supported, all backed by one C core.
pip install compress-utils
Self-contained wheels (no system codec libraries) with PEP 561 type stubs, for CPython 3.11–3.15 including free-threaded 3.14t and 3.15t, on Linux (manylinux, x86-64 and aarch64), macOS (Apple silicon) and Windows (x86-64); other platforms such as musl Linux, Intel macOS and Windows on Arm build from the source distribution, which needs a C and C++ toolchain.
import compress_utils as cu
data = b"the quick brown fox jumps over the lazy dog" * 100
compressed = cu.compress(data, "zstd", level=5)
restored = cu.decompress(compressed, "zstd")
assert restored == data
Algorithm names accept both lowercase strings ("zstd", "brotli", …) and the typed enum:
cu.compress(data, cu.Algorithm.zstd, level=5)
compress-utils for Python against other Python compression libraries: speed against compression ratio.
Measured on AWS c8g.xlarge (Graviton4), dickens (10.2 MB of text), one-shot, 2026-10-29.
Full results here.
| Algorithm | Spelling | Wire format |
|---|---|---|
| Zstandard | "zstd" |
ZSTD frame with content size |
| Brotli | "brotli" |
Raw Brotli stream |
| zlib | "zlib" |
zlib wrapper (RFC 1950) |
| gzip | "gzip" |
gzip stream (RFC 1952) |
| bzip2 | "bz2" (also "bzip2") |
bzip2 stream |
| LZ4 | "lz4" |
LZ4 frame (interoperable with the lz4 CLI and .lz4 files) |
| XZ / LZMA | "xz" (also "lzma") |
XZ stream with CRC64 |
| Snappy | "snappy" |
Raw Snappy block (interoperable with reference snappy and python-snappy) |
| DEFLATE | "deflate" |
Raw DEFLATE (RFC 1951), no wrapper |
| LZ4 block | "lz4_raw" |
Raw LZ4 block, no frame or size prefix (one-shot compression, incremental decompression) |
| LZO1X | "lzo" |
Raw LZO1X block (decompression only) |
cu.is_available(name_or_enum) returns True for algorithms compiled into the installed wheel.
expected_sizeRaw block formats such as those inside Parquet and ORC pages don't record their decompressed size, so pass expected_size, an upper bound on the output; the result holds only the bytes actually decoded. More in the advanced guide.
page = cu.decompress(block, "lz4_raw", expected_size=uncompressed_page_size)
For inputs that don't fit in memory or arrive incrementally:
from compress_utils import CompressStream, DecompressStream
cs = CompressStream("zstd", level=5)
chunks = [cs.compress(chunk) for chunk in iter_chunks(some_file)]
chunks.append(cs.finish())
compressed = b"".join(chunks)
ds = DecompressStream("zstd")
restored = ds.decompress(compressed) + ds.finish()
Streaming does not hold the whole result in memory, so a multi-GB file is fine. To stop at the end of one frame or member and get the bytes after it, pass single_stream=True; see stopping at the end of a stream.
Every algorithm accepts a level from 1 (fastest) to 10 (smallest). The binding maps this to each algorithm's native range automatically, so you don't need to know that Zstandard goes 1–22 and zlib goes 1–9. It defaults to 5 if omitted.
Decompression is bounded by default: output is capped at 1 GiB, so a hostile or corrupt input cannot exhaust memory. Change the cap with set_max_decompressed_size, and see the untrusted input guidance in the project README for what else to set when you decompress data you don't control.
cu.version() # e.g. "0.12.2"
cu.set_max_decompressed_size(256 * 1024**2) # cap decompress() for every algorithm
# (default: 1 GiB; 0 = unbounded)
ds = cu.DecompressStream("gzip", max_output=256 * 1024**2) # streams: no limit unless set
try:
cu.decompress(garbage, "zstd")
except cu.CompressError as e:
print(e)
The package ships PEP 561 type stubs; type checking shows what they report.
Wheels for free-threaded Python 3.14 and 3.15 (python3.14t, python3.15t) run without the GIL, so calls on different threads run in parallel. On regular Python, large calls (256 KiB or more of input) release the GIL so other threads keep running; when streaming, feed chunks of 256 KiB or more.
A CompressStream or DecompressStream can be shared between threads: calls on one stream run one at a time. More in the advanced guide.
MIT. See LICENSE.
Part of compress-utils. Built by Nico Dupont.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.