async-typer-0.1.9
توضیحات
A simple async wrapper for typer
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | async-typer-0.1.9 |
| نام | async-typer |
| نسخه کتابخانه | 0.1.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | byunjuneseok |
| ایمیل نویسنده | byunjuneseok@gmail.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/async-typer/ |
| مجوز | - |
# async-typer
`async-typer` is a _simple async wrapper_ for the [typer](https://github.com/tiangolo/typer) library.
We already have a lot of async implementations for our applications, but we can't use them easily with typer.
With this simple wrapper, we can use async functions in CLI with typer-like interface.
And `async-typer` have more features than typer to solve our real-world problems in a more elegant way.
## Installation
```bash
pip install async-typer
```
## How to use
```python
from async_typer import AsyncTyper
app = AsyncTyper()
@app.command()
def foo():
service.work()
@app.async_command()
async def bar():
await service.work_async()
```
## FastAPI-like event handlers
Handle startup and shutdown events with async or sync functions.
```python
app.add_event_handler("startup", redis_async_pool_manager.init_redis_pool)
app.add_event_handler("shutdown", redis_async_pool_manager.close_redis_pool)
```
Please check the [typer documentation](https://typer.tiangolo.com/) for more information.
نیازمندی
| مقدار | نام |
|---|---|
| - | typer<1.0.0,>=0.9.0 |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| <4.0,>=3.10 | Python |
نحوه نصب
نصب پکیج whl async-typer-0.1.9:
pip install async-typer-0.1.9.whl
نصب پکیج tar.gz async-typer-0.1.9:
pip install async-typer-0.1.9.tar.gz