Skip to main content

ASGI adapter for Azure Functions

Project description

Bonnette

ASGI adapter for Azure Functions.

Package version Build Status

Requirements: Python 3.6

Installation

pip3 install bonnette

Example

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)

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

Uploaded Source

File details

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

File metadata

  • Download URL: bonnette-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 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.34.0 CPython/3.6.8rc1

File hashes

Hashes for bonnette-0.1.1.tar.gz
Algorithm Hash digest
SHA256 70ef837c523bce1785bfd43400311c73bed4971884b30d21583e067e0b28e2cf
MD5 ce0409182d487341b50e9026dc66efdf
BLAKE2b-256 e258440a1dadad51d86a69592eca4822840b6f7f4659c695637dc5fcc43e01b1

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