Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

compress-utils

Latest version: v0.12.2

Overview

Last scanned
24 Nov 2026
Published
23 Nov 2026
PyPI package Publisher: dupontcyborg
8 Stars
2 Forks
7 Versions
11.7K Downloads
C Repo language

Scan summary

compress-utils was last scanned on 24 Nov 2026 at version 0.12.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 7 versions; the latest was published on 23 Nov 2026.
  • Findings: No rules fired in version 0.12.2.
  • Downloads: 11,719 downloads.

Versions

7 versions published
Versions and the rules that fired in each
VersionPublishedStatus
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

No rules fired in 0.12.2

Findings

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.

README

The publisher’s own README, as collected from the registry.

compress-utils

PyPI version Python Versions Python build License: MIT

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.

Installation

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.

Quick start

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)

Performance

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.

Supported algorithms

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.

Raw blocks and expected_size

Raw 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)

Streaming

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.

Compression levels

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.

Errors and limits

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.

Concurrency

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.

License

MIT. See LICENSE.


Part of compress-utils. Built by Nico Dupont.

OX Radar and Response Center

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.

Where it’s listed

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).

  • pypi-releases compress-utils

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

PHP2Shell, Day 5 93.6% of Measurable Instances Still Unpatched (1)
Vulnerability Insights

PHP2Shell, Day 5: The Panic Hasn’t Turned Into Patching

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Frame 2085668439 (1)
Group 1261154229