Registry / web-framework / starlette-cramjam

starlette-cramjam

JSON →
library0.7.0pypypiunverified

Middleware that adds compression (gzip, brotli, zstd, deflate) to Starlette ASGI applications using the cramjam library. Version 0.7.0; releases are irregular.

pip install starlette-cramjam
INSTALL
IMPORT
SIG · STARLETTE-CRAMJAM
S
starlette-cramjam
web-frameworkpythonv0.7.0
Install
2.3s avg
Import
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 25.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.3s · import 0.000s · 26MB
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CompressMiddleware
from starlette_cramjam.middleware import CompressMiddleware
from starlette_cramjam import CompressMiddleware

Basic Starlette app with compression middleware enabled.

from starlette.applications import Starlette from starlette.responses import PlainTextResponse from starlette.routing import Route from starlette_cramjam.middleware import CompressMiddleware async def hello(request): return PlainTextResponse("Hello, World!") app = Starlette(routes=[Route('/', hello)]) app.add_middleware(CompressMiddleware)
Debug
Known issues
breakingPython 3.9 and 3.10 support dropped in version 0.6.0; requires Python >=3.11.
fix
Upgrade Python to 3.11+ or pin to starlette-cramjam <0.6.0.
affects: >=0.6.0
gotchaThe middleware may skip compression for small responses based on default minimum size (min_size). Responses smaller than 500 bytes are not compressed.
fix
Set min_size=0 in CompressMiddleware(min_size=0) to compress all responses.
affects: all
Upgrade
Version history
0.7.0latest on PyPI · released Apr 27, 2026
Audit
Dependencies
starletterequiredRequired for ASGI middleware and request/response handling.
cramjamrequiredCompression/decompression backend for gzip, brotli, zstd, deflate.
Agent activity
19 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
starlette-cramjam — pip install starlette-cramjam · libregistry