click-lazy

LazyGroup implementation for Click which imports only nessesery commands


License
Apache-2.0
Install
pip install click-lazy==0.0.1

Documentation

click-lazy

$ click_lazy

Click lazy is an extention for click.

Click lazy allow you to separate set of commands in file and import it only if necessary.

A Simple Example

from click_lazy import LazyGroup

...

if __name__ == '__main__':
    # This group of commands will import group_heavy only if needed
    cli.add_command(LazyGroup(name='heavy', import_name='group_heavy:cli'))

    cli()

group_heavy.py

import click


@click.group()
def cli():
    """Havy script"""


@cli.command(name='heavy_cmd')
def run_heavy_cmd():
    print('Running command from heavy group file')

See complete example on github

Links