cramjam
Thin Python bindings to de/compression algorithms in Rust
Decision gist · record as of 2026-08-14
Yes. Cramjam is worth installing if you need fast, zero-dependency compression in Python. It has no runtime dependencies, active maintenance, a permissive license, no known vulnerabilities, and broad platform support. The medium install friction (platform-specific wheels) is a one-time cost. Use it when you want to avoid system library dependencies or need algorithms beyond Python's built-in zlib and bz2.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Medium install friction due to platform-specific wheels (precompiled binaries for multiple architectures), but no runtime dependencies to resolve.
- Active maintenance with recent commits and a stable release cadence.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute cramjam freely in commercial and private projects with minimal restrictions.
last release 2025-07-27 (383 days) · last repo commit 2026-05-18 · 124 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 34,689,918 downloads/mo, #756 on PyPI
Alternatives
Verify before relying
pip install cramjam
import cramjam
compressed = cramjam.snappy.compress(b"bytes here")
decompressed = cramjam.snappy.decompress(compressed)
print(bytes(decompressed))- Performance comparison with native Python compression libraries (zlib, bz2) to justify Rust implementation overhead
- Whether experimental algorithms (Blosc2, ISA-L variants) are production-ready or still under active development
- Support timeline and compatibility guarantees for Python versions beyond 3.8
What it is and what it does
Cramjam wraps Rust implementations of nine standard compression algorithms behind a thin Python interface. It lets you compress and decompress data using Snappy, Brotli, Bzip2, Lz4, Gzip, Zlib, Deflate, ZSTD, or XZ without installing system libraries or additional Python packages. The library ships as precompiled wheels for most platforms and Python versions, so installation is straightforward.
The API is uniform across all algorithms: each module (cramjam.snappy, cramjam.brotli, etc.) exposes compress() and decompress() methods that accept bytes, bytearray, numpy arrays, memoryview, or cramjam.Buffer objects. For in-place operations, compress_into() and decompress_into() variants write directly to a target buffer. The package is actively maintained, has no runtime dependencies, and is widely downloaded, making it a practical choice when you need fast, dependency-free compression in Python.
Use it for
- Compress data payloads in network protocols or storage systems where Snappy or Brotli are required by the spec
- Decompress files in legacy formats (Bzip2, XZ) without installing separate command-line tools
- Speed up data serialization in scientific or machine-learning pipelines by compressing numpy arrays directly
- Build cross-platform applications that need compression without managing system-level zlib or libbz2 installations
- Benchmark or prototype different compression algorithms on the same data without rewriting code for each one
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Cramjam is worth installing if you need fast, zero-dependency compression in Python. It has no runtime dependencies, active maintenance, a permissive license, no known vulnerabilities, and broad platform support. The medium install friction (platform-specific wheels) is a one-time cost. Use it when you want to avoid system library dependencies or need algorithms beyond Python's built-in zlib and bz2.
Install
cramjam on PyPI
Before you install
Medium install friction due to platform-specific wheels (precompiled binaries for multiple architectures), but no runtime dependencies to resolve. Active maintenance with recent commits and a stable release cadence.
License in practice
MIT license is permissive; you can use, modify, and distribute cramjam freely in commercial and private projects with minimal restrictions.
Quickstart
pip install cramjam
import cramjam
compressed = cramjam.snappy.compress(b"bytes here")
decompressed = cramjam.snappy.decompress(compressed)
print(bytes(decompressed))
Verify before relying
- Performance comparison with native Python compression libraries (zlib, bz2) to justify Rust implementation overhead
- Whether experimental algorithms (Blosc2, ISA-L variants) are production-ready or still under active development
- Support timeline and compatibility guarantees for Python versions beyond 3.8
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 383 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 34,689,918 / month, #756 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: cramjam-2.11.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl; cramjam-2.11.0-cp310-cp310-macosx_10_12_x86_64.whl; cramjam-2.11.0-cp310-cp310-macosx_11_0_arm64.whl; cramjam-2.11.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl; cramjam-2.11.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; cramjam-2.11.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; cramjam-2.11.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; cramjam-2.11.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl; cramjam-2.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; cramjam-2.11.0-cp310-cp310-musllinux_1_1_aarch64.whl; cramjam-2.11.0-cp310-cp310-musllinux_1_1_armv7l.whl; cramjam-2.11.0-cp310-cp310-musllinux_1_1_i686.whl; cramjam-2.11.0-cp310-cp310-musllinux_1_1_x86_64.whl; cramjam-2.11.0-cp310-cp310-win32.whl; cramjam-2.11.0-cp310-cp310-win_amd64.whl; cramjam-2.11.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl; cramjam-2.11.0-cp311-cp311-macosx_10_12_x86_64.whl; cramjam-2.11.0-cp311-cp311-macosx_11_0_arm64.whl; cramjam-2.11.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.whl; cramjam-2.11.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “snappy brotli zstd python”
- cramjamProvides fast Python bindings to multiple compression and…
- starlette-compressMiddleware for Starlette and FastAPI that compresses HTTP responses…
- starlette-cramjamMiddleware for Starlette that compresses HTTP responses using Brotli,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also python-snappy · starlette-cramjam · deflate · pyoxipng · lz4 · fastar · pyzstd · FastWARC · brotlicffi · zlib-ng