Skip to main content

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

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.

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 for more information.

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.8.tar.gz (1.6 kB view details)

Uploaded Source

Built Distribution

async_typer-0.1.8-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file async_typer-0.1.8.tar.gz.

File metadata

  • Download URL: async_typer-0.1.8.tar.gz
  • Upload date:
  • Size: 1.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1019-azure

File hashes

Hashes for async_typer-0.1.8.tar.gz
Algorithm Hash digest
SHA256 315897613e37628587848cb99d1098b9dada662c61973553d9db7ae4c17f3a48
MD5 56255e8443cddab6c5131d09bf087064
BLAKE2b-256 6af78e0082b6b0004c879e701e42a73335f73a64dca8e6ca7917dea6750b5349

See more details on using hashes here.

File details

Details for the file async_typer-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: async_typer-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 2.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1019-azure

File hashes

Hashes for async_typer-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a16d19e9519aee38541321a30a40a9c3c10d46465cc475519a0818a26dead3c5
MD5 7771c44b90c74183efa6813a185bc968
BLAKE2b-256 21e7bb506c61dd9dfafd38d8645aad2995c7d8a4014371ab0ddfd3b04ab3c827

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page