Click Supercharged is a Python package that enhances the Click command-line framework by adding support for default commands, command aliases, and abbreviations. Simplify command management with features like ambiguity resolution and improved command organization.
Project description
Click Supercharged
Overview
click-supercharged is a Python package that enhances the Click command line interface framework by providing support for default commands and command aliases. This project allows developers to organize their command-line interfaces in a more flexible and user-friendly manner.
Features
- Default Command: Specify a default command that executes when no command is provided.
- Command Aliases: Create multiple aliases for commands to improve usability and avoid lengthy command names.
- Abbreviations: Use abbreviations instead the full command. Handles ambiguous command inputs gracefully and informs the user about multiple matches.
Installation
You can install click-supercharged via PyPI:
pip install click-supercharged
Usage
To use the SuperchargedClickGroup, you can set it as the command group in your Click application as shown below:
import click
from click_supercharged import SuperchargedClickGroup
@click.group(cls=SuperchargedClickGroup)
def cli():
pass
@cli.command(default_command=True, aliases=["bar"])
def foo():
click.echo("foo")
@cli.command(aliases=["bax", "bez", "buz"])
def baz():
click.echo("baz")
if __name__ == "__main__":
cli()
Running your CLI
When you run the script, you can execute:
python your_script.pyto invoke the default commandfoo.python your_script.py fto invoke the commandfoousing its abbreviation.python your_script.py bato see error handling for ambiguous commands.
Testing
The project includes unit tests to ensure functionality. You can run the tests using the following command:
python -m unittest discover
Contributing
Contributions are welcome! Please submit a pull request or open an issue to discuss improvements or features.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Click - The command-line interface framework that this project builds upon.
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
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_supercharged-1.0.0.tar.gz.
File metadata
- Download URL: click_supercharged-1.0.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4426d4b572230012734c777974f65fc5ffd05d4df3b35367301320a14f75a1b8
|
|
| MD5 |
d75bef19a7ed4de576a3d71d4930c70b
|
|
| BLAKE2b-256 |
433a9b57c2382791c06f68730928f34bf12b4dcbfeb6d2ca85b78f9c40b0f130
|
Provenance
The following attestation bundles were made for click_supercharged-1.0.0.tar.gz:
Publisher:
python-publish.yml on zirition/click-supercharged
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
click_supercharged-1.0.0.tar.gz -
Subject digest:
4426d4b572230012734c777974f65fc5ffd05d4df3b35367301320a14f75a1b8 - Sigstore transparency entry: 164048970
- Sigstore integration time:
-
Permalink:
zirition/click-supercharged@78280c78f1900b47fe92c8fc7508c4974dd96614 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/zirition
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@78280c78f1900b47fe92c8fc7508c4974dd96614 -
Trigger Event:
release
-
Statement type:
File details
Details for the file click_supercharged-1.0.0-py3-none-any.whl.
File metadata
- Download URL: click_supercharged-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8731ab8403e4f9536f7bfc6801c33c6ecb8a42fd658888d8af1605f1e82a6d1
|
|
| MD5 |
ccdcab1c75e2e443071f3619c7bd10ec
|
|
| BLAKE2b-256 |
85909e6526f1413c31a53b8aabbd4dba3e69d735f92cb92381f052fdee98532c
|
Provenance
The following attestation bundles were made for click_supercharged-1.0.0-py3-none-any.whl:
Publisher:
python-publish.yml on zirition/click-supercharged
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
click_supercharged-1.0.0-py3-none-any.whl -
Subject digest:
b8731ab8403e4f9536f7bfc6801c33c6ecb8a42fd658888d8af1605f1e82a6d1 - Sigstore transparency entry: 164048973
- Sigstore integration time:
-
Permalink:
zirition/click-supercharged@78280c78f1900b47fe92c8fc7508c4974dd96614 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/zirition
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@78280c78f1900b47fe92c8fc7508c4974dd96614 -
Trigger Event:
release
-
Statement type: