Skip to main content

Tests

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.py to invoke the default command foo.
  • python your_script.py f to invoke the command foo using its abbreviation.
  • python your_script.py ba to 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.

Release files for click-supercharged 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for click-supercharged 1.0.0
File Size Uploaded
click_supercharged-1.0.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for click-supercharged 1.0.0
File Interpreter ABI Platform
click_supercharged-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / click_supercharged-1.0.0.tar.gz

Download URL click_supercharged-1.0.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4426d4b572230012734c777974f65fc5ffd05d4df3b35367301320a14f75a1b8
BLAKE2b-256 checksum
How to use checksums
433a9b57c2382791c06f68730928f34bf12b4dcbfeb6d2ca85b78f9c40b0f130
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 21, 2025.

Transparency log

Release files / click_supercharged-1.0.0-py3-none-any.whl

Download URL click_supercharged-1.0.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8731ab8403e4f9536f7bfc6801c33c6ecb8a42fd658888d8af1605f1e82a6d1
BLAKE2b-256 checksum
How to use checksums
85909e6526f1413c31a53b8aabbd4dba3e69d735f92cb92381f052fdee98532c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 21, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page