Skip to main content

Agraffe, build API with ASGI in Google Cloud Functions.

Project description

Agraffe, build API with ASGI in Google Cloud Functions.

Requirements

Python 3.7+

Installation

$ pip install agraffe

Example

Create it

  • Create a file mail.py with:
from agraffe import Agraffe

from typing import Optional

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def read_root():
    return {"Hello": "World"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: Optional[str] = None):
    return {"item_id": item_id, "q": q}


def entry_point(request):
    agraffe = Agraffe(app)
    return agraffe(request)

Deploy it

  • Deploy the api with:
$ gcloud functions deploy {FUNCTION NAME} --entry-point entry_point --runtime python37 --trigger-http --allow-unauthenticated

License

This project is licensed under the terms of the MIT license.

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

agraffe-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

agraffe-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file agraffe-0.1.0.tar.gz.

File metadata

  • Download URL: agraffe-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.24.0

File hashes

Hashes for agraffe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e8d05ec87542318dd95c710b096107e567f77725122a65c28276fdeade9c6ab8
MD5 0682263466f5ef82ead6226107a60abc
BLAKE2b-256 41057d9a579d77d2741073d08c13c243769df8836251ab1e9732435500094fbb

See more details on using hashes here.

File details

Details for the file agraffe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agraffe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.24.0

File hashes

Hashes for agraffe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70f10e6e23c68c5f9d14d63cb61b6db8e298ca71b8b1b631b0c1920afe6f4758
MD5 239a068efa9b9063f417f6f3604858f7
BLAKE2b-256 37633cc9a417122fc55aec4ea50d01d0d23c94e38d9c372a6ccbaa2cf63a0a39

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