Catalog PyPI
Back to packageRELEASE DETAILS

1.12.0

PyPI

aiocli

Simple and lightweight async console runner.

aioasyncasynciocliconsole
Published12 Oct 2025
Direct dependencies21
Transitive dependenciesNot calculated

README

Version 1.12.0 documentation

Async cli client/commander framework

PyPI version PyPIDownloads CI

aiocli is a Python library for simple and lightweight async console runner.

Full compatibility with argparse module and highly inspired by aiohttp module.

Installation

Use the package manager pip to install aiocli.

pip install aiocli

Documentation

Usage

from logging import getLogger, Logger, StreamHandler
from os import getenv

from aiocli.commander import run_app, Application, Depends, State

app = Application(state={
    'envs': {
        'LOGGER_NAME': str(getenv('LOGGER_NAME', 'example_app')),
        'LOGGER_LEVEL': str(getenv('LOGGER_LEVEL', 'INFO')),
    }
})

def _get_logger(state: State) -> Logger:
    logger = getLogger(state.get('envs')['LOGGER_NAME'])
    logger.setLevel(state.get('envs')['LOGGER_LEVEL'])
    handler = StreamHandler()
    logger.addHandler(handler)
    return logger

@app.command(name='greet:to', positionals=[('name', {'default': 'World!'})])
async def handle_greeting(name: str, logger: Logger = Depends(_get_logger)) -> int:
    logger.info(f'Hello {name}')
    return 0

@app.command(name='div', optionals=[('--a', {'type': float}), ('--b', {'type': float})])
async def handle_division(a: float, b: float, logger: Logger = Depends(_get_logger)) -> int:
    try:
        logger.info(f'Result {a} / {b} = {(a / b)}')
        return 0
    except BaseException as err:
        logger.error(f'Error: {err}')
        return 1

# python3 main.py <command> <positionals> <optionals>
if __name__ == '__main__':
    run_app(app)

Requirements

  • Python >= 3.10

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 22

Native requirements
21 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
pre-commit
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pre-commit>=4.3.0; extra == "dev"runtime
tomli
Environment
{
  "extras": "",
  "marker": "python_version < \"3.11\" and extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
tomli>=2.3.0; python_version < "3.11" and extra == "dev"runtime
types-toml
Environment
{
  "extras": "",
  "marker": "python_version < \"3.11\" and extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
types-toml>=0.10.8.20240310; python_version < "3.11" and extra == "dev"runtime
build
Environment
{
  "extras": "",
  "marker": "extra == \"deploy\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
build>=1.3.0; extra == "deploy"runtime
setuptools
Environment
{
  "extras": "",
  "marker": "extra == \"deploy\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
setuptools>=75.1.0; extra == "deploy"runtime
twine
Environment
{
  "extras": "",
  "marker": "extra == \"deploy\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
twine>=6.2.0; extra == "deploy"runtime
wheel
Environment
{
  "extras": "",
  "marker": "extra == \"deploy\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
wheel>=0.45.1; extra == "deploy"runtime
mkdocs
Environment
{
  "extras": "",
  "marker": "extra == \"docs\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
mkdocs>=1.6.1; extra == "docs"runtime
mkdocs-material
Environment
{
  "extras": "",
  "marker": "extra == \"docs\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
mkdocs-material>=9.6.21; extra == "docs"runtime
black
Environment
{
  "extras": "",
  "marker": "extra == \"fmt\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
black>=25.9.0; extra == "fmt"runtime
isort
Environment
{
  "extras": "",
  "marker": "extra == \"fmt\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
isort<7.0.0; extra == "fmt"runtime
bandit
Environment
{
  "extras": "",
  "marker": "extra == \"security-analysis\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
bandit>=1.8.6; extra == "security-analysis"runtime
liccheck
Environment
{
  "extras": "",
  "marker": "extra == \"security-analysis\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
liccheck>=0.9.2; extra == "security-analysis"runtime
setuptools
Environment
{
  "extras": "",
  "marker": "extra == \"security-analysis\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
setuptools>=75.1.0; extra == "security-analysis"runtime
mypy
Environment
{
  "extras": "",
  "marker": "extra == \"static-analysis\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
mypy>=1.18.2; extra == "static-analysis"runtime
pylint
Environment
{
  "extras": "",
  "marker": "extra == \"static-analysis\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pylint>=3.3.9; extra == "static-analysis"runtime
nest-asyncio
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
nest-asyncio>=1.6.0; extra == "test"runtime
psutil
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
psutil>=7.1.0; extra == "test"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest>=8.4.2; extra == "test"runtime
pytest-asyncio
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest-asyncio>=1.2.0; extra == "test"runtime
pytest-cov
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest-cov>=7.0.0; extra == "test"runtime
pytest-xdist
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest-xdist>=3.8.0; extra == "test"runtime

Distribution files

2 collected
aiocli-1.12.0-py3-none-any.whl

bdist_wheel · 13.86 KB · Python py3

Source file
aiocli-1.12.0.tar.gz

sdist · 15.98 KB · Python source

Source file

Repository

PENDING
aiopy/python-aiocli

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:43 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:c170baedeaa7101b9e1b2d06db450e2ced3b24f23a5faf8833eb51ccc01476c6

Other collected versions

View all collected versions →