No project description provided
Project description
async-typer
async-typer
is a simple async wrapper for the typer library.
We already have a lot of async implementations for our applications, but we can't use them easily with typer.
And async-typer
have more features than typer to solve our real-world problems in a more elegant way.
Installation
pip install async-typer
How to use
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.
app.add_event_handler("startup", redis_async_pool_manager.init_redis_pool)
app.add_event_handler("shutdown", redis_async_pool_manager.close_redis_pool)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
async_typer-0.1.3.tar.gz
(1.6 kB
view details)
Built Distribution
File details
Details for the file async_typer-0.1.3.tar.gz
.
File metadata
- Download URL: async_typer-0.1.3.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d87f11fb14c0e5af4d2b2fd9dcfa1a7e132599d565ca8f42a9ea5dfd06a50c3c |
|
MD5 | 7a0b8e612daeb85786387685e183209c |
|
BLAKE2b-256 | f5e566c15b46619ff63d362e0a6aa3ed948c3a5f7c3646769fdef94a3bca9d2a |
File details
Details for the file async_typer-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: async_typer-0.1.3-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/22.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2398d61f8a07226286f3ce53816cb7827e01dc156ab1a1a9f57d6a0fd305711b |
|
MD5 | 38764c5679133faaa636733d7e168361 |
|
BLAKE2b-256 | cc2397433229b6f8c22f59eb45e30382bdd337ff6e93084c0bae812f0bcee5b5 |