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.

Compared with other converters, the advantage is that a2wsgi will not accumulate the requested content or response content in the memory, so you don't have to worry about the memory limit caused by a2wsgi. This problem exists in converters implemented by uvicorn/startlette or hypercorn.

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

You can convert an existing WSGI project to an ASGI project to make it easier to migrate from WSGI applications to ASGI applications.

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.7.0.tar.gz (12.9 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.7.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: a2wsgi-1.7.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.1.1 CPython/3.8.16

File hashes

Hashes for a2wsgi-1.7.0.tar.gz
Algorithm Hash digest
SHA256 a906f62c0250eb0201120b93417dd0b12b105b5db35af431bfe86ef0dc5bbab2
MD5 80b5e1366e89b7b9c025ee1922f3d2fe
BLAKE2b-256 df2a1e317b1a9d5013ab7f881bd8fed76459fc5c36ac4896799266f0207bae53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: a2wsgi-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.1.1 CPython/3.8.16

File hashes

Hashes for a2wsgi-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d26be288b2a5f368181b6e0d1cfc3c2a4180732cca10e9cc4b9bc333235b8d80
MD5 eaef29744bd9bfb9ab96958f7bd116fc
BLAKE2b-256 c5b8ccf880c8a3e564283f0ed1b4268e13e4cb9075491b0863f9a2bf83d5e58a

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