Name | async-typer JSON |
Version |
0.1.9
JSON |
| download |
home_page | None |
Summary | A simple async wrapper for typer |
upload_time | 2025-07-26 11:03:50 |
maintainer | None |
docs_url | None |
author | byunjuneseok |
requires_python | <4.0,>=3.10 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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.
Raw data
{
"_id": null,
"home_page": null,
"name": "async-typer",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "byunjuneseok",
"author_email": "byunjuneseok@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/27/58/0fec521a302095c31574e12fc5320d82842cf6647eb8b5da17d7512404b7/async_typer-0.1.9.tar.gz",
"platform": null,
"description": "# async-typer\n\n`async-typer` is a _simple async wrapper_ for the [typer](https://github.com/tiangolo/typer) library. \nWe already have a lot of async implementations for our applications, but we can't use them easily with typer.\nWith this simple wrapper, we can use async functions in CLI with typer-like interface.\nAnd `async-typer` have more features than typer to solve our real-world problems in a more elegant way.\n\n## Installation\n\n```bash\npip install async-typer\n```\n\n## How to use\n\n```python\nfrom async_typer import AsyncTyper\n\n\napp = AsyncTyper()\n\n@app.command()\ndef foo():\n service.work()\n\n@app.async_command()\nasync def bar():\n await service.work_async()\n\n```\n\n\n## FastAPI-like event handlers\n\nHandle startup and shutdown events with async or sync functions.\n\n```python\napp.add_event_handler(\"startup\", redis_async_pool_manager.init_redis_pool)\napp.add_event_handler(\"shutdown\", redis_async_pool_manager.close_redis_pool)\n```\n\nPlease check the [typer documentation](https://typer.tiangolo.com/) for more information.\n",
"bugtrack_url": null,
"license": null,
"summary": "A simple async wrapper for typer",
"version": "0.1.9",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "789cf061fc1418540dc52e7997d0699dcc7bf5c2743151de948abf581fc8b4de",
"md5": "4859aac87976c3da324bf3efa6ad14fe",
"sha256": "e22e70c8de4d9e01bd61bc708f48199f1a1d461148e8a1323edf5a1246489f4d"
},
"downloads": -1,
"filename": "async_typer-0.1.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4859aac87976c3da324bf3efa6ad14fe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 2184,
"upload_time": "2025-07-26T11:03:49",
"upload_time_iso_8601": "2025-07-26T11:03:49.828060Z",
"url": "https://files.pythonhosted.org/packages/78/9c/f061fc1418540dc52e7997d0699dcc7bf5c2743151de948abf581fc8b4de/async_typer-0.1.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "27580fec521a302095c31574e12fc5320d82842cf6647eb8b5da17d7512404b7",
"md5": "2d98607722571388623c609df36c1fc2",
"sha256": "14a7344dd02efebc7efd2c26980cbbb1f3bf241a06d361ba6b3ed030358a0752"
},
"downloads": -1,
"filename": "async_typer-0.1.9.tar.gz",
"has_sig": false,
"md5_digest": "2d98607722571388623c609df36c1fc2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 1626,
"upload_time": "2025-07-26T11:03:50",
"upload_time_iso_8601": "2025-07-26T11:03:50.881734Z",
"url": "https://files.pythonhosted.org/packages/27/58/0fec521a302095c31574e12fc5320d82842cf6647eb8b5da17d7512404b7/async_typer-0.1.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-26 11:03:50",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "async-typer"
}