Incenp.Click-Shell - A shell extension for Click
Incenp.Click-Shell is an extension to click that easily turns your Click-powered Python command-line application into a shell utility. It is built on top of the built in Python cmd module, with modifications to make it work with Click.
Features
Adds a “shell” mode with command completion to any Click app.
Just a one line change for most click apps.
Usage
Simply replace @click.group with @incenp.click_shell.shell on the root level command:
import click
from incenp.click_shell import shell
# @click.group() # no longer
@shell(prompt='my-app> ', intro='Starting my app...')
def my_app():
pass
@my_app.command()
def testcommand():
click.echo("testcommand is running")
# more commands
if __name__ == '__main__':
my_app()
When run, you should expect an output like so:
$ python my_app.py
Starting my app...
my-app> testcommand
testcommand is running
my-app>
Using the Incenp.Click-Shell decorator alters the functionality of your program only when the program is called without a subcommand argument. Otherwise, your app will function identically to how it did before.
History
Incenp.Click-Shell is a fork of Clark Perkins’ click-shell, motivated by the lack of recent development in the original project and in particular the lack of support for recent versions of Click, which introduced changes that completely broke the original click-shell.
Incenp.Click-Shell is used in exactly the same way as the original click-shell, the only difference being that the module to import is named incenp.click_shell instead of click_shell.
Importantly, in this fork Python 2 support has been completely removed. If support for Python 2 is important for you, then you may keep using the original click-shell module instead; it won’t work with Click 8, but if you’re using Python 2 you’re stuck with older versions of Click anyway, since Click 8 also dropped support for Python 2.
Copying
Incenp.Click-Shell is distributed under a 3-clause BSD license. The full license is included in the LICENSE file of the source distribution.
Homepage and repository
The project is located at https://github.com/gouttegd/click-shell with the manual at https://incenp.org/dvlpt/click-shell/index.html.
Metadata
Release files for incenp.click-shell 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| incenp.click-shell-2.1.0.tar.gz | 21.6 kB | Without provenance | Details for incenp.click-shell-2.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| incenp.click_shell-2.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for incenp.click_shell-2.1.0-py2.py3-none-any.whl |
Total release size: 33.6 kB
Release files / incenp.click-shell-2.1.0.tar.gz
| Download URL | incenp.click-shell-2.1.0.tar.gz |
|---|---|
| Size | 21.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5c0c6cafdac670c1bb989338b03a93f245aea6ad01768a1b3ed2cbdd842c103
|
|
BLAKE2b-256 checksum How to use checksums |
6d7bc6fd80ecd279c3dbf58a3950c2291f46c826ecd8aa35e38685fcaf290920
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|
Release files / incenp.click_shell-2.1.0-py2.py3-none-any.whl
| Download URL | incenp.click_shell-2.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
6243f4b915d6b46f259565d0237bbc72e1c52df79ad308ed8040e06397f9e3ab
|
|
BLAKE2b-256 checksum How to use checksums |
141c272f206d989a576886a5b25314001f04008652f3f70c37f87aee6a987f32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|
Security for incenp.click-shell 2.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.