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 customized click.group definition, allowing one to quickly define a group of commands, which can be extended by any package using the group defined thus. From thereon, simply installing one's core module, and the third-party extension would automatically extend the core's CLI with the third-party.
As an example, here is how one would define an extensible click.group in
their python package core_module:
from extencli import PluginAutoloaderGroup
@click.group('core', cls=PluginAutoloaderGroup, depends_on='core_module', load_attr='cli_extension')
def core_group():
...
The base_module and attribute_name parameter are required to ensure that:
- automated loading of the third-party packages will be done based on the dependency to
core_module - third-party packages will be expected to provide a
cli_extensionfunction as their extension's entrypoint
Thus, a third party would merely need to do the following, in order for it to
be automatically loaded by the core_module auto-extension mechanism:
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, one would be able to observe that the core_module's CLI was
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.1.tar.gz.
File metadata
- Download URL: extencli-0.1.1.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 |
5a9b8bb389bc805410e1280065fe52373aa3a41f95d6a6acc2cbcd5175d3eaa0
|
|
| MD5 |
3c18d9e6bf47fc3498c60cba55d46f3a
|
|
| BLAKE2b-256 |
dc8c157da32f486c02a693d1d03149a5d1ebadd07a55461c3afae9f9bbebcb8c
|
Provenance
The following attestation bundles were made for extencli-0.1.1.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.1.tar.gz -
Subject digest:
5a9b8bb389bc805410e1280065fe52373aa3a41f95d6a6acc2cbcd5175d3eaa0 - Sigstore transparency entry: 634638885
- Sigstore integration time:
-
Permalink:
Joacchim/extencli@bc75c090ea9d14a7bcf2d8d5a78280c2b1c9a87d -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/Joacchim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@bc75c090ea9d14a7bcf2d8d5a78280c2b1c9a87d -
Trigger Event:
push
-
Statement type:
File details
Details for the file extencli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: extencli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 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 |
db7eede5cc0cb10071d18cdc4bf693100be69e32d269c52d4f407fbb7fc48eae
|
|
| MD5 |
4e43ca8a09458d654d46de286ec3a157
|
|
| BLAKE2b-256 |
fcdf6e334e5216f689e4ec6822bdc784bb9c2aa3636daff53fd3a8231c4992de
|
Provenance
The following attestation bundles were made for extencli-0.1.1-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.1-py3-none-any.whl -
Subject digest:
db7eede5cc0cb10071d18cdc4bf693100be69e32d269c52d4f407fbb7fc48eae - Sigstore transparency entry: 634638886
- Sigstore integration time:
-
Permalink:
Joacchim/extencli@bc75c090ea9d14a7bcf2d8d5a78280c2b1c9a87d -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/Joacchim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@bc75c090ea9d14a7bcf2d8d5a78280c2b1c9a87d -
Trigger Event:
push
-
Statement type: