A set of utilities around click, for extensible CLI
Project description
extencli
A set of utilities around click, which offers extensible CLI mechanism, with little effort
Features
Easy third-party extensible click.group
This package offers a specialized click.group implementation. Using it, you can create a CLI that will be extended by simply installing additional modules.
As an example, here is how one would define an extensible click.group in
their python package core_module:
import click
from extencli import PluginAutoloaderGroup
@click.group('core', cls=PluginAutoloaderGroup, depends_on='core_module', load_attr='cli_extension')
def core_group():
...
The depends_on and load_attr parameters are required:
depends_onspecifies the name of the package that CLI extensions should depend onload_attrstates the symbol that CLI extensions must provide as subcommands of thecore_group
Please note that the load_attr attribute defines that the cli_extension
symbol must be exposed as a top level attribute of any core_module extension
module.
Now, the CLI extension package should import the core_group from the
core_module like so:
from core_module.cli import core_group
@core_group.command('myext')
def cli_extension():
...
Now, by simply installing both the core_module and the extension
third-party, the core_module will be extended with the myext command:
$> core --help
Usage: core [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
myext
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
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 extencli-0.1.2.tar.gz.
File metadata
- Download URL: extencli-0.1.2.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4b73816b062e6676695f7186e74b277b5693c6ef77130fe02947fbe6c681c08
|
|
| MD5 |
1216f69fe2b99d16101a3afa3f8c1409
|
|
| BLAKE2b-256 |
f89fb956315b0960e3c51a9222279baa6a65a351c73ac363511167d289b419b6
|
Provenance
The following attestation bundles were made for extencli-0.1.2.tar.gz:
Publisher:
workflow.yml on Joacchim/extencli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
extencli-0.1.2.tar.gz -
Subject digest:
a4b73816b062e6676695f7186e74b277b5693c6ef77130fe02947fbe6c681c08 - Sigstore transparency entry: 636822391
- Sigstore integration time:
-
Permalink:
Joacchim/extencli@985d1646cd56f6914c87ff497e3e633e9dec5e85 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/Joacchim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@985d1646cd56f6914c87ff497e3e633e9dec5e85 -
Trigger Event:
push
-
Statement type:
File details
Details for the file extencli-0.1.2-py3-none-any.whl.
File metadata
- Download URL: extencli-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58910601520efb778f788cd22e6959c98255867967996d9a40b7c0982098ddd8
|
|
| MD5 |
594bba3c89186cb3857f1b4ab47a667e
|
|
| BLAKE2b-256 |
e5344e8b70da5e2bca82405c980e6a7b953b0e82ae38330b977a4c544583fc08
|
Provenance
The following attestation bundles were made for extencli-0.1.2-py3-none-any.whl:
Publisher:
workflow.yml on Joacchim/extencli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
extencli-0.1.2-py3-none-any.whl -
Subject digest:
58910601520efb778f788cd22e6959c98255867967996d9a40b7c0982098ddd8 - Sigstore transparency entry: 636822419
- Sigstore integration time:
-
Permalink:
Joacchim/extencli@985d1646cd56f6914c87ff497e3e633e9dec5e85 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/Joacchim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@985d1646cd56f6914c87ff497e3e633e9dec5e85 -
Trigger Event:
push
-
Statement type: