alicorn-0.0.3
توضیحات
A grpc framework
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | alicorn-0.0.3 |
| نام | alicorn |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Chris Stranex |
| ایمیل نویسنده | chris@stranex.com |
| آدرس صفحه اصلی | https://gitlab.com/cstranex/alicorn |
| آدرس اینترنتی | https://pypi.org/project/alicorn/ |
| مجوز | - |
Alicorn
========
Alicorn is a Python grpc framework with built in dependency injection and middleware management.
NB: This project is in alpha status at the moment, some functionality may be missing.
```python
from alicorn import Alicorn, GrpcContext, Depends
from helloworld_pb2 import HelloWorldRequest, HelloWorldResponse
from helloworld_pb2_grpc import HelloWorldServicer
app = Alicorn()
app.debug = True
class Database:
pass
@app.service
class HelloWorld(HelloWorldServicer):
def SayHello(self, request: HelloWorldRequest, context: GrpcContext, *, database: Database = Depends()):
return HelloWorldResponse(message=f"Hello {request.name}")
if __name__ == '__main__':
app.run()
```
## Features
- Dependency Injection
- before_request, after_request, after_request_teardown request handlers
- .proto defined grpc services or python-defined grpc services
- Extension Support
## Planned Future Features
- Incoming data validation (using proto rules)
- More internal extensions
- Other grpc server support (besides the Google implementation)
## Requirements
- Python 3.7+
- grpcio
## Installation
From PyPi: `pip install alicorn` or `pipenv install alicorn`
## To Do
- Finish Documentation
- Command-Line Options
- Better examples
نیازمندی
| مقدار | نام |
|---|---|
| >=1.29.0 | grpcio |
| >=3.10 | protobuf |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl alicorn-0.0.3:
pip install alicorn-0.0.3.whl
نصب پکیج tar.gz alicorn-0.0.3:
pip install alicorn-0.0.3.tar.gz