Skip to main content

Azure Functions ASGI adapter

Project description

Bonnette

ASGI adapter for Azure Functions.

Requirements: Python 3.6

Installation

$ pip3 install bonnette

Example

Bonnette consists of a single adapter class for using ASGI applications on Azure Functions, example usage:

from bonnette import Bonnette


class App:
    def __init__(self, scope):
        self.scope = scope

    async def __call__(self, receive, send):
        await send(
            {
                "type": "http.response.start",
                "status": 200,
                "headers": [[b"content-type", b"text/plain"]],
            }
        )
        await send({"type": "http.response.body", "body": b"Hello, world!"})


handler = Bonnette(App)

Dependencies

azure-functions - required for Azure Function support. Can be installed using:

Frameworks

Any ASGI framework should work with Bonnette, however there are cases where certain non-ASGI behaviour of an application will causes issues when deploying to a serverless platform.

Support

This adapter was originally part of Mangum, a project for ASGI support on AWS Lambda & API Gateway. It was forked because I'd rather focus on supporting a single platform well, Bonnette will likely not get as much attention unless there becomes a strong interest by others in using it.

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

bonnette-0.0.1.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file bonnette-0.0.1.tar.gz.

File metadata

  • Download URL: bonnette-0.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.8rc1

File hashes

Hashes for bonnette-0.0.1.tar.gz
Algorithm Hash digest
SHA256 978c4f123b151a12d2a8adf5b4cf54c39b763de726caad1d44db7479a02a61fc
MD5 d9dde54ee9f44c7f5375d0473114bca8
BLAKE2b-256 d66dc7d7b404bea7c00c903a99b4485f189465cc34b97b1b07d1431baee38688

See more details on using hashes here.

Supported by

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