AClick

AClick is a wrapper library around click and provides the command() and group() decorators as well as Command and Group classes. The decorators will automatically register aclick types and if you supply your own Command or Group implementation, they will wrap it as an aclick type.

Similarly to Click, decorating a function with click.command() will make it into a callable script. However, with aclick we do not need to specify parameter types, defaults and help, but everything is parsed automatically from type annotations and docstring:

# Click example
import click

@click.command()
@click.argument('name')
@click.option('--age',
    default=18, type=int,
    help='Your age')
def hello(name, age):
    '''
    Prints greeting
    '''


    click.echo(f'Hello {name}!')
# AClick example
import aclick, click





@aclick.command()
def hello(name: str, /, age: int = 18):
    '''
    Prints greeting

    :param age: Your age
    '''
    click.echo(f'Hello {name} with age {age}!')

In both cases the resulting Command can be invoked:

if __name__ == '__main__':
    hello()

And what it looks like:

$ python hello.py Jonas --age 25
Hello Jonas with age 25!

And the corresponding help page:

$ python hello.py --help
Usage: hello.py [OPTIONS] NAME

  Prints greeting

Options:
  --help         Show this message and exit.
  --age INTEGER  Your age  [default: 18]

Documentation

API Reference

The API reference lists the full API reference of all public classes and functions.