starlette-cramjam
Cramjam integration for Starlette ASGI framework.
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a common Starlette use case with a clean API. Install it if you need HTTP compression middleware for a Starlette application and want support for multiple algorithms beyond the standard library.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later.
- Low friction: pure Python wheel with only two runtime dependencies (cramjam and starlette).
- Actively maintained with a recent release and no known vulnerabilities.
License · maintenance · safety
permissive license (permissive) — MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and commercial projects.
last release 2026-04-27 (109 days) · last repo commit 2026-07-23 · 20 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 212,832 downloads/mo, #9,449 on PyPI
Alternatives
Verify before relying
pip install starlette-cramjam
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette_cramjam.middleware import CompressionMiddleware
app = Starlette(
middleware=[Middleware(CompressionMiddleware)]
)What it is and what it does
starlette-cramjam is a Starlette ASGI middleware that automatically compresses HTTP responses using one or more compression algorithms (Brotli, GZip, Deflate, ZSTD). It inspects the client's Accept-Encoding header and applies the appropriate algorithm, handling both standard and streaming responses transparently. The middleware is built on top of cramjam, which provides Rust-backed compression bindings for performance.
You configure it by specifying which compression algorithms to support, the compression level (0–11), a minimum response size threshold to avoid compressing small payloads, and optional path or media-type exclusions. It integrates directly into Starlette's middleware stack with minimal setup and requires only Python 3.11 or later.
Use it for
- Reduce bandwidth and improve response times for text-heavy APIs by automatically compressing JSON or HTML responses.
- Support multiple compression standards (Brotli, GZip, Deflate, ZSTD) to accommodate diverse client preferences without manual negotiation.
- Exclude specific routes or media types (e.g., already-compressed images) from compression to avoid overhead.
- Tune compression level per deployment environment to balance CPU cost and bandwidth savings.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, low install friction, and solves a common Starlette use case with a clean API. Install it if you need HTTP compression middleware for a Starlette application and want support for multiple algorithms beyond the standard library.
Install
starlette-cramjam on PyPI
Before you install
Low friction: pure Python wheel with only two runtime dependencies (cramjam and starlette). Actively maintained with a recent release and no known vulnerabilities.
Requires Python 3.11 or later.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and commercial projects.
Quickstart
pip install starlette-cramjam
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette_cramjam.middleware import CompressionMiddleware
app = Starlette(
middleware=[Middleware(CompressionMiddleware)]
)
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagescramjamstarlette |
| Maintenance | Actively maintained 109 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 212,832 / month, #9,449 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed |
Evidence: starlette_cramjam-0.7.0-py3-none-any.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 › “starlette compression middleware”
- starlette-cramjamMiddleware for Starlette that compresses HTTP responses using Brotli,…
- starlette-compressMiddleware for Starlette and FastAPI that compresses HTTP responses…
- brotli-asgiBrotliMiddleware adds Brotli compression to ASGI applications as a…
Give your agent the search over MCP, or paste the wish link into any chat.
More WWW/HTTP packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
h11 is a pure-Python HTTP/1.1 protocol implementation that handles parsing and serializing HTTP messages without any built-in I/O, letting you integrate it with any network layer you choose.
HTTPX is a fully featured HTTP client library for Python that provides both sync and async APIs, with support for HTTP/1.1 and HTTP/2, plus an integrated command-line client.
Install it if you are building new projects or modernizing existing ones that rely on HTTP.
A minimal low-level HTTP client library that sends HTTP requests with thread-safe and task-safe connection pooling, supporting HTTP/1.1, HTTP/2, proxies, and both sync and async interfaces.
aiohttp is an async HTTP client and server framework built on asyncio, supporting both WebSockets and middleware-based routing for building concurrent web applications.
Install it if you need async HTTP client or server capabilities in asyncio-based applications.
See also brotli-asgi · cramjam · starlette · starlette-compress · Flask-Compress · starsessions · asgi-correlation-id · starlette-context · starlette-testclient · opentelemetry-util-http