elefantolib-fastapi-0.2.0
توضیحات
-
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | elefantolib-fastapi-0.2.0 |
| نام | elefantolib-fastapi |
| نسخه کتابخانه | 0.2.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | gglassota |
| ایمیل نویسنده | gglassota2@gmail.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/elefantolib-fastapi/ |
| مجوز | - |
## Elefantolib for FastAPI
> **_NOTE:_** Only for this library developers. After clone this repository you should run command:
>
```console
git config core.hooksPath .githooks
```
## Installation
<div class="termy">
```console
poetry add elefantolib-fastapi
```
</div>
## Example
### Prepare
* Add environmental variables
```
SECRET=
ALGORITHM=
ISSUER=
```
* Defaults:
- SECRET - not set, this is required
- ALGORITHM=HS256
- ISSUER=Consumer
### Create it
* Create a file `main.py` with:
```Python
from elefantolib_fastapi.requests import ElefantoRequest
from elefantolib_fastapi.routes import ElefantoRoute
from fastapi import FastAPI
app = FastAPI()
app.router.route_class = ElefantoRoute
@app.get('/')
def index(request: ElefantoRequest):
# TODO something
response = request.pfm.services.some_service_name.get('path-to-endpoint')
return response
```
نیازمندی
| مقدار | نام |
|---|---|
| >=0.9.2,<0.10.0 | elefantolib |
| >=0.95.1,<0.96.0 | fastapi |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10,<4.0 | Python |
نحوه نصب
نصب پکیج whl elefantolib-fastapi-0.2.0:
pip install elefantolib-fastapi-0.2.0.whl
نصب پکیج tar.gz elefantolib-fastapi-0.2.0:
pip install elefantolib-fastapi-0.2.0.tar.gz