agraffe-0.6.0
توضیحات
Agraffe, build API with ASGI in Serverless services (e.g AWS lambda, Google Cloud Functions and Azure Functions).
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | agraffe-0.6.0 |
| نام | agraffe |
| نسخه کتابخانه | 0.6.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | odd <odd12258053@gmail.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/agraffe/ |
| مجوز | - |

[](https://badge.fury.io/py/agraffe)

Agraffe, build API with ASGI in Serverless services (e.g AWS lambda, Google Cloud Functions and Azure Functions).
## Support Services
- [x] Google Cloud Functions
- Python 3.7, 3.8, 3.9, 3.10, 3.11(preview)
- [x] AWS lambda (with API Gateway HTTP API or REST API, or with Function URL)
- Python 3.7, 3.8, 3.9
- [x] Azure Functions
- Python 3.7, 3.8, 3.9, 3.10(preview)
## Requirements
Python 3.7+
## Installation
```sh
$ pip install agraffe
```
## Example
Create it
- Create a file `main.py` with:
```python
from agraffe import Agraffe
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: str | None = None):
return {"item_id": item_id, "q": q}
entry_point = Agraffe.entry_point(app)
```
```python
# or, for on GCP
from agraffe.services.google_cloud_functions import HttpCycle
def entry_point(request):
return Agraffe(app, HttpCycle)(request=request)
```
Deploy it
- Deploy the api with:
```sh
$ gcloud functions deploy {FUNCTION NAME} --entry-point entry_point --runtime python310 --trigger-http --allow-unauthenticated
```
See `/example` for other services.
## License
This project is licensed under the terms of the MIT license.
نیازمندی
| مقدار | نام |
|---|---|
| =4.0.0 | typing-extensions |
| =0.93 | mypy |
| =4.0.1 | flake8 |
| =22.3. | black |
| =5.10.1 | isort |
| =1.5.0 | azure-functions |
| =6.2.5 | pytest |
| =0.93 | mypy |
| =4.0.1 | flake8 |
| =22.3. | black |
| =5.10.1 | isort |
| =1.5.0 | azure-functions |
| =3.0. | functions-framework |
| =0.89. | fastapi |
| =1.10. | pydantic |
| =0.0. | python-multipart |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl agraffe-0.6.0:
pip install agraffe-0.6.0.whl
نصب پکیج tar.gz agraffe-0.6.0:
pip install agraffe-0.6.0.tar.gz