skillfed

cross-web

A library for working with web frameworks

cross-web v0.7.0 4.7M downloads/30d#2,256 on PyPI10
Permissive license MIT Active released

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-web

uv

uv add cross-web

poetry

poetry add cross-web

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

framework-agnostic web adapterwrite once run everywhere webunified web framework interfacecross-framework request handlingframework abstraction layer pythonmulti-framework http clientportable web code
framework-abstractiontesting-utilitiesasgi-wsgi

More Libraries packages