{"id":2905,"library":"cross-web","title":"cross-web","description":"Cross-web is a Python library (version 0.4.1) providing a unified interface for common web framework operations, allowing developers to write framework-agnostic code for popular Python web frameworks like FastAPI, Flask, and Django. It is actively developed with recent releases addressing bug fixes and framework support, and was last updated in January 2026.","status":"active","version":"0.4.1","language":"en","source_language":"en","source_url":"https://github.com/usecross/cross-web","tags":["web-framework","adapter","http","fastapi","flask","django","aiohttp","sanic","quart","chalice"],"install":[{"cmd":"pip install cross-web","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"The package was renamed from `lia-web` to `cross-web` in version 0.4.0. While `lia-web` acts as a compatibility shim, direct imports from `cross_web` are recommended.","wrong":"from lia_web import Response","symbol":"Response","correct":"from cross_web import Response"},{"symbol":"Request","correct":"from cross_web import Request"}],"quickstart":{"code":"from cross_web import Request, Response\n\ndef my_framework_agnostic_handler(request: Request) -> Response:\n    # This function represents a handler written using cross-web's abstractions\n    name = request.query_params.get('name', 'World')\n    body_content = f\"Hello, {name}! This is a cross-web response.\"\n    return Response(\n        status_code=200,\n        headers={'Content-Type': 'text/plain'},\n        body=body_content.encode('utf-8')\n    )\n\n# --- Example of how a web framework adapter might use it ---\n# In a real application, a framework-specific adapter would create\n# the Request object and handle the Response object.\n\n# Simulate an incoming request\nsimulated_request = Request(\n    method=\"GET\",\n    path=\"/greeting\",\n    headers={\n        \"Host\": \"example.com\",\n        \"User-Agent\": \"curl/7.81.0\"\n    },\n    query_params={\n        \"name\": \"cross-web user\"\n    },\n    body=b''\n)\n\n# Call the framework-agnostic handler\nresponse_obj = my_framework_agnostic_handler(simulated_request)\n\n# Output the response details (what a framework adapter might send back)\nprint(f\"Status: {response_obj.status_code}\")\nprint(f\"Headers: {response_obj.headers}\")\nprint(f\"Body: {response_obj.body.decode('utf-8')}\")","lang":"python","description":"This quickstart demonstrates the core concept of `cross-web`: defining framework-agnostic `Request` and `Response` objects. In a real application, a specific web framework (like Flask or FastAPI) would use a `cross-web` adapter to convert its native request/response objects to `cross-web`'s types, allowing you to write your business logic using these unified types. This example is runnable and simulates the creation and processing of these objects."},"warnings":[{"fix":"Update all import statements from `from lia_web import ...` to `from cross_web import ...`. While `lia-web` acts as a shim, direct imports are recommended for future compatibility.","message":"The package name and import path changed from `lia-web` to `cross-web` in version 0.4.0. Code using `from lia_web import ...` will need to be updated.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Install and use `cross-web` directly. Update all imports from `lia_web` to `cross_web`.","message":"The `lia-web` package is now deprecated. It acts as a compatibility shim for `cross-web` but should not be used for new projects or ongoing development.","severity":"deprecated","affected_versions":">=0.4.0"},{"fix":"Ensure Pydantic is explicitly listed in your project's dependencies if your code relies on its presence. `cross-web` itself no longer requires it.","message":"Pydantic was removed as a dependency in version 0.2.2. If your application implicitly relied on Pydantic being a dependency of `cross-web` (e.g., for schema validation outside of `cross-web`'s explicit use), it might break.","severity":"gotcha","affected_versions":">=0.2.2"},{"fix":"Upgrade to `cross-web` version 0.2.1 or higher to ensure correct multipart form data processing, especially when using the AioHTTP adapter.","message":"A fix for handling multipart form data in the AioHTTP integration was introduced in version 0.2.1. Older versions might have issues with file uploads or on-demand processing.","severity":"gotcha","affected_versions":"<0.2.1"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}