cross-web
A library for working with web frameworks
What it is and what it does
Cross is a web framework adapter that lets you write request/response handling code once and reuse it across multiple Python web frameworks. Instead of rewriting handlers for FastAPI, Flask, Django, and others, you write against Cross's unified interface and adapt it to each framework via framework-specific request adapters. The package ships with testing clients for each supported framework, all exposing the same async API for making HTTP requests in tests.
The core use case is reducing boilerplate when building libraries or tools that need to work across multiple frameworks. It abstracts common operations like reading request bodies, accessing query parameters, and building responses into a framework-neutral layer. The testing module is particularly useful for integration tests that need to verify handler behavior without coupling to a specific framework's test utilities.
Use it for:
- Build a reusable library or middleware that works with FastAPI, Flask, Django, and Starlette without framework-specific forks.
- Write integration tests for handlers using a unified async client API across different framework test environments.
- Migrate request-handling logic between frameworks by adapting to Cross's interface instead of rewriting handler signatures.
- Prototype web handlers framework-agnostically and defer framework selection until later in development.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cross provides a unified interface for writing framework-agnostic web code that adapts to FastAPI, Flask, Django, Starlette, and other Python web frameworks without rewriting.
Yes, with conditions: install if you need to write framework-agnostic web code or test handlers across multiple frameworks. The low install friction, permissive license, and active maintenance make it safe to try. However, the description's 'early development' caveat conflicts with the 'Production/Stable' classifier — verify stability for your use case before relying on it in production. No known vulnerabilities.
Install
cross-web on PyPI
pip
pip install cross-webuv
uv add cross-webpoetry
poetry add cross-webInstalling cross-web
Before you install
Low friction: pure Python wheel with a single runtime dependency (typing-extensions). Active maintenance with a recent release (87 days ago) and no known vulnerabilities.
License in practice
MIT license (permissive) — you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install cross-web
from cross_web.request._starlette import StarletteRequestAdapter
from cross_web.testing.clients.starlette import StarletteHttpClient
adapter = StarletteRequestAdapter(request)
body = await adapter.get_body()
Requires Python 3.9 or later. Framework-specific adapters (Starlette, Flask, Django, etc.) are optional but needed to use the unified interface with those frameworks.
Verify before relying
- Maturity and stability: despite 'Production/Stable' classifier, the description states 'in early development' — actual production readiness unclear.
- Scope of framework coverage: which operations are unified across all supported frameworks vs. framework-specific gaps.
- Performance overhead of the abstraction layer compared to direct framework use.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — typing-extensions |
| Maintenance | actively maintained — 87 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,680,106/month — #2,256 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cross_web-0.7.0-py3-none-any.whl
Keywords: asgi, framework, http, request, response, web, wsgi
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
starletteStarlette is a lightweight ASGI framework for…
permissive · top 100 on PyPI
lia-weblia-web is a deprecated shim package that…
permissive · top 15,000 on PyPI
jinja_partialsAdds a `render_partial()` function to Jinja2…
permissive · top 5,000 on PyPI
fastapi-csrf-protectAdds stateless CSRF protection to FastAPI…
permissive · top 15,000 on PyPI
uvicornUvicorn is an ASGI web server that runs async…
permissive · top 100 on PyPI
django-webtestIntegrates WebTest with Django's testing…
permissive · top 15,000 on PyPI
opentelemetry-util-httpProvides ASGI and WSGI middleware and HTTP…
permissive · top 1,000 on PyPI
gunicornGunicorn is a WSGI and ASGI HTTP server for…
permissive · top 1,000 on PyPI
awsgi2Bridges WSGI-compatible web frameworks to AWS…
permissive · top 15,000 on PyPI
zappaZappa packages and deploys Python WSGI and ASGI…
permissive · top 15,000 on PyPI