--- id: a2wsgi version: "1.10.10" license: Apache-2.0 license_treatment: permissive maintenance: active --- # a2wsgi — Convert WSGI app to ASGI app or ASGI app to WSGI app. License: permissive · Maintenance: active · Downloads: 12.2M/mo ## What it is and what it does a2wsgi is a bidirectional converter between WSGI and ASGI application interfaces. It wraps a WSGI app to run as ASGI (using a thread pool of up to 10 threads by default) or wraps an ASGI app to run as WSGI (with optional timeout for background tasks). The core design avoids accumulating request or response content in memory, streaming data instead—a difference from converters in uvicorn, startlette, or hypercorn that may buffer entire payloads. The package is pure Python, depends only on typing_extensions at runtime, and requires Python 3.8 or later. It exposes the original WSGI environ or ASGI scope through special keys, allowing applications to access protocol-level details when needed. Typical use is migrating legacy WSGI projects to ASGI frameworks or deploying ASGI apps in WSGI-only hosting environments. Use it for: - Migrate a Flask or Django WSGI app to run on an ASGI server like Starlette or FastAPI without rewriting the application. - Deploy a FastAPI or Starlette ASGI app on traditional WSGI-only hosting (e.g., Apache with mod_wsgi). - Handle large file uploads or streaming responses without memory overhead in WSGI-to-ASGI conversion. - Bridge WSGI and ASGI middleware in a single application stack for gradual framework migration. - Access original protocol details (WSGI environ or ASGI scope) from the opposite protocol layer. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Converts between WSGI and ASGI applications bidirectionally without buffering request or response content in memory. Yes. a2wsgi solves a real problem—bidirectional WSGI/ASGI conversion without memory buffering—with low install friction, active maintenance, no known vulnerabilities, and a permissive license. Install it when you need to bridge WSGI and ASGI applications or migrate between them. ## Install pip install a2wsgi uv add a2wsgi poetry add a2wsgi ## Installing a2wsgi Before you install: Low friction: pure Python with only typing_extensions as a runtime dependency. Active maintenance with recent releases; last commit 2026-03-22 and latest release 2025-06-18. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most deployment scenarios. Quickstart: # Convert WSGI app to ASGI from a2wsgi import WSGIMiddleware ASGI_APP = WSGIMiddleware(WSGI_APP) # Or convert ASGI app to WSGI from a2wsgi import ASGIMiddleware WSGI_APP = ASGIMiddleware(ASGI_APP) Requires Python 3.8 or later. WSGIMiddleware uses a thread pool (default 10 threads) and queue (default size 10) which may need tuning for high-concurrency workloads. Verify before relying: - Performance characteristics compared to uvicorn/startlette/hypercorn converters beyond memory buffering claims - Thread pool behavior under high concurrency or with workers parameter tuning - Queue size tuning guidance for different workload profiles ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 12.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags wsgi to asgi converter, asgi to wsgi adapter, wsgi asgi bridge, convert wsgi app to asgi, asgi middleware wsgi, streaming wsgi asgi, low memory wsgi conversion, wsgi-asgi-bridge, streaming-middleware, framework-migration [View on SkillFed](https://skillfed.io/packages/a2wsgi) · [View on PyPI](https://pypi.org/project/a2wsgi/)