LazyGroup implementation for Click which imports only nessesery commands
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
click-lazy-0.0.1.tar.gz
(8.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file click-lazy-0.0.1.tar.gz.
File metadata
- Download URL: click-lazy-0.0.1.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2b73c2425ce064d414049921b5a4ff415711a867aa448f2af0941819f5a3ab1
|
|
| MD5 |
9524d24425f3f50c7fab0be772a70f00
|
|
| BLAKE2b-256 |
72411d5d9aedd177905da437ce8293d7036161d44242411689cc8cc525ef95c5
|
File details
Details for the file click_lazy-0.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: click_lazy-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
786e97a0845731f306cbf9ffed23310c729345842aaf8eb3ec0aac2f420fa098
|
|
| MD5 |
a7a4d0bf08f8092cb775146bedb49024
|
|
| BLAKE2b-256 |
630baca4379e86cf4c4f14fa0074867ced1c13f549d2c813f6737f6ad0a27f55
|