Skip to main content

Convert WSGI app to ASGI app or ASGI app to WSGI app.

Project description

a2wsgi

Convert WSGI app to ASGI app or ASGI app to WSGI app.

Pure Python. Only depend on the standard library.

Install

pip install a2wsgi

How to use

Convert WSGI app to ASGI app:

from a2wsgi import WSGIMiddleware

ASGI_APP = WSGIMiddleware(WSGI_APP)

Convert ASGI app to WSGI app:

from a2wsgi import ASGIMiddleware

WSGI_APP = ASGIMiddleware(ASGI_APP)

Benchmark

Run pytest ./benchmark.py -s to compare the performance of a2wsgi and uvicorn.middleware.wsgi.WSGIMiddleware / asgiref.wsgi.WsgiToAsgi.

Why a2wsgi

Convert WSGI app to ASGI app

The uvicorn-WSGIMiddleware dealing with large file uploads, it is easy to cause insufficient memory uvicorn/issue#371. a2wsgi uses asyncio.run_coroutine_threadsafe to regulate the pace of reading data, thus solving this problem.

Convert ASGI app to WSGI app

There is a lot of support for WSGI. Converting ASGI to WSGI, you will be able to use many existing services to deploy ASGI applications.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a2wsgi-1.3.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a2wsgi-1.3.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file a2wsgi-1.3.0.tar.gz.

File metadata

  • Download URL: a2wsgi-1.3.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.3 CPython/3.7.9 Linux/5.4.0-1031-azure

File hashes

Hashes for a2wsgi-1.3.0.tar.gz
Algorithm Hash digest
SHA256 4ea0ca19b4b4afa767d300b5e5eee88b95879988299c065bd7c88d26b6904e71
MD5 16721075c7e96c75eab50a1aa4d01180
BLAKE2b-256 d598916cda5b07220ee1db50654464d6e302c921ac2f7b2e5a13e57053efcf64

See more details on using hashes here.

File details

Details for the file a2wsgi-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: a2wsgi-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.3 CPython/3.7.9 Linux/5.4.0-1031-azure

File hashes

Hashes for a2wsgi-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f34bee12c91fba093361fb30698d595913671b106fa960fa9a160ad2d4296b80
MD5 d61436e031f92e583d3d89fc1818e9f8
BLAKE2b-256 740b34b2f2b96809fc55efc06c98ce97bd214128b12a8a7d614396bf823f29cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page