GCP Cloud Functions support for ASGI applications
Project description
Vellox
Vellox is an adapter for running ASGI applications in GCP Cloud Functions.
Requirements
Python 3.8+
Installation
pip install vellox
Example
from vellox import Vellox
async def app(scope, receive, send):
await send(
{
"type": "http.response.start",
"status": 200,
"headers": [[b"content-type", b"text/plain; charset=utf-8"]],
}
)
await send({"type": "http.response.body", "body": b"Hello, world!"})
vellox = Vellox(app=app, lifespan="off")
def handler(request):
return vellox(request)
Or using a framework:
from fastapi import FastAPI
from vellox import Vellox
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
return {"item_id": item_id, "q": q}
vellox = Vellox(app=app, lifespan="off")
def handler(request):
return vellox(request)
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
vellox-0.2.0.tar.gz
(17.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
vellox-0.2.0-py3-none-any.whl
(10.9 kB
view details)
File details
Details for the file vellox-0.2.0.tar.gz.
File metadata
- Download URL: vellox-0.2.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88c0fa1bd931bc1de45c1a2f2df20e167bd52f4b28aa84d42a46638e2e081da1
|
|
| MD5 |
dc8df8848d824b53d535351b4a495770
|
|
| BLAKE2b-256 |
650b685e8bef978139554fc6b036b87eacb0f81c6422bc691f9f71531961faf5
|
File details
Details for the file vellox-0.2.0-py3-none-any.whl.
File metadata
- Download URL: vellox-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b1909411279458b3d8e0bee6646aae4cf40bd51f9a42e56622a95b288b28483
|
|
| MD5 |
ec61c92a5698e0cc6430fb42a37da3db
|
|
| BLAKE2b-256 |
62bf93974e76723b8160c5c3809033ae7d3ea5e3803e79725204cde3f23389c0
|