--- id: cross-web version: "0.7.0" license: MIT license_treatment: permissive maintenance: active --- # cross-web — A library for working with web frameworks License: permissive · Maintenance: active · Downloads: 4.7M/mo ## 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 above — 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 pip install cross-web uv add cross-web 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_current - Install friction: low - Maintenance: active - Downloads: 4.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags framework-agnostic web adapter, write once run everywhere web, unified web framework interface, cross-framework request handling, framework abstraction layer python, multi-framework http client, portable web code, framework-abstraction, testing-utilities, asgi-wsgi [View on SkillFed](https://skillfed.io/packages/cross-web) · [View on PyPI](https://pypi.org/project/cross-web/)