Current collected state Current
Observed since 21 Oct, 09:25 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
agraffe
Agraffe, build API with ASGI in Serverless services (e.g AWS lambda, Google Cloud Functions and Azure Functions).
![]()
Agraffe, build API with ASGI in Serverless services (e.g AWS lambda, Google Cloud Functions and Azure Functions).
Python 3.7+
$ pip install agraffe
Create it
main.py with:import contextlib
from agraffe import Agraffe
from fastapi import FastAPI, Request
@contextlib.asynccontextmanager
async def lifespan(app):
yield {'message': 'hello'}
app = FastAPI(lifespan=lifespan)
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q}
@app.get("/lifespan")
def lifespan_(request: Request):
return {"count": request.state.message}
entry_point = Agraffe.entry_point(app)
# or, for on GCP
from agraffe.services.google_cloud_functions import HttpCycle
def entry_point(request):
return Agraffe(app, HttpCycle)(request=request)
Deploy it
$ gcloud functions deploy {FUNCTION NAME} --entry-point entry_point --runtime python310 --trigger-http --allow-unauthenticated
See /example for other services.
This project is licensed under the terms of the MIT license.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
typing-extensionsEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | typing-extensions >=4.0.0, <5.0.0 | runtime |
mypyEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | mypy ==0.931 ; extra == "dev" | runtime |
flake8Environment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | flake8 >=4.0.1, <5.0.0 ; extra == "dev" | runtime |
blackEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | black ==22.3.0 ; extra == "dev" | runtime |
isortEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | isort >=5.10.1, <6.0.0 ; extra == "dev" | runtime |
azure-functionsEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | azure-functions >=1.5.0, <2.0 ; extra == "dev" | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"test\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | pytest >=7.2.1, <8.0.0 ; extra == "test" | runtime |
mypyEnvironment{
"extras": "",
"marker": "extra == \"test\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | mypy ==0.931 ; extra == "test" | runtime |
flake8Environment{
"extras": "",
"marker": "extra == \"test\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | flake8 >=4.0.1, <5.0.0 ; extra == "test" | runtime |
blackEnvironment{
"extras": "",
"marker": "extra == \"test\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | black ==22.3.0 ; extra == "test" | runtime |
isortEnvironment{
"extras": "",
"marker": "extra == \"test\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | isort >=5.10.1, <6.0.0 ; extra == "test" | runtime |
azure-functionsEnvironment{
"extras": "",
"marker": "extra == \"test\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | azure-functions >=1.5.0, <2.0 ; extra == "test" | runtime |
functions-frameworkEnvironment{
"extras": "",
"marker": "extra == \"test\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | functions-framework ==3.0.0 ; extra == "test" | runtime |
fastapiEnvironment{
"extras": "",
"marker": "extra == \"test\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | fastapi >=0.94.0 ; extra == "test" | runtime |
pydanticEnvironment{
"extras": "",
"marker": "extra == \"test\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | pydantic >=1.10.4 ; extra == "test" | runtime |
python-multipartEnvironment{
"extras": "",
"marker": "extra == \"test\"",
"requires_python": ">=3.7",
"evaluation": "NOT_EVALUATED"
} | python-multipart >=0.0.5 ; extra == "test" | runtime |
bdist_wheel · 8.64 KB · Python py3
sdist · 51.12 KB · Python source
Observed since 21 Oct, 09:25 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:4c192b357f3af978b1d903e9d2da4795a9ea92bc17cbcd13ed563314a2c93eaf