Skip to main content

Azure Functions ASGI adapter

Project description

Bonnette

ASGI adapter for Azure Functions.

Package version Build Status

Requirements: Python 3.6

Installation

pip3 install bonnette

Example

Bonnette consists of a single adapter class for using ASGI applications on Azure Functions.

import logging
import azure.functions as func
from bonnette import Bonnette


async def app(scope, receive, send):
    assert scope["type"] == "http"
    await send(
        {
            "type": "http.response.start",
            "status": 200,
            "headers": [[b"content-type", b"text/html; charset=utf-8"]],
        }
    )
    await send(
        {"type": "http.response.body", "body": b"<html><h1>Hello, world!</h1></html>"}
    )


def main(req: func.HttpRequest) -> func.HttpResponse:
    logging.info("Python HTTP trigger function processed a request.")
    handler = Bonnette(app)
    return handler(req)

Dependencies

azure-functions - required for Azure Function support.

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.3.tar.gz (3.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: bonnette-0.0.3.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8rc1

File hashes

Hashes for bonnette-0.0.3.tar.gz
Algorithm Hash digest
SHA256 e9adad0d5082296643bb7962e0265815642e4c3b153b968e8b0f8e3a6993f184
MD5 43c3c3b526a176423dc5552c9b93b787
BLAKE2b-256 23a17caa6c2429d59d3fec1b66091b2ebd2eb9d77a9141dfa566d04adb031cb3

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