Metadata-Version: 2.4 Name: shtab Version: 1.13.0 Summary: Automagic shell tab completion for Python CLI applications Author-email: Casper da Costa-Luis Maintainer-email: tqdm developers License: MPL-2.0 Project-URL: documentation, https://tqdm.github.io/shtab Project-URL: repository, https://github.com/tqdm/shtab Project-URL: changelog, https://github.com/tqdm/shtab/releases Keywords: tab,completion,argparse,shell,bash,zsh,tcsh,fish,powershell,pwsh Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Console Classifier: Environment :: MacOS X Classifier: Environment :: Other Environment Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Education Classifier: Intended Audience :: End Users/Desktop Classifier: Intended Audience :: Other Audience Classifier: Intended Audience :: System Administrators Classifier: Operating System :: MacOS Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX Classifier: Operating System :: POSIX :: BSD Classifier: Operating System :: POSIX :: BSD :: FreeBSD Classifier: Operating System :: POSIX :: Linux Classifier: Operating System :: POSIX :: SunOS/Solaris Classifier: Operating System :: Unix Classifier: Programming Language :: Other Scripting Engines Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3.14 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Unix Shell Classifier: Topic :: Desktop Environment Classifier: Topic :: Education :: Computer Aided Instruction (CAI) Classifier: Topic :: Education :: Testing Classifier: Topic :: Office/Business Classifier: Topic :: Other/Nonlisted Topic Classifier: Topic :: Software Development Classifier: Topic :: Software Development :: Build Tools Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Software Development :: Pre-processors Classifier: Topic :: Software Development :: User Interfaces Classifier: Topic :: System Classifier: Topic :: System :: Installation/Setup Classifier: Topic :: System :: Shells Classifier: Topic :: System :: System Shells Classifier: Topic :: Terminals Classifier: Topic :: Utilities Requires-Python: >=3.9 Description-Content-Type: text/x-rst License-File: LICENCE Provides-Extra: dev Requires-Dist: pytest>=6; extra == "dev" Requires-Dist: pytest-cov; extra == "dev" Requires-Dist: click; extra == "dev" Dynamic: license-file |Logo| shtab ===== |Tests| |Coverage| |Quality| |PyPI| |Conda| |PyPI-Downloads| |Licence| - What: Automatically generate shell tab completion scripts for Python CLI apps - Why: Speed & correctness. Alternatives like `argcomplete `_ and `pyzshcomplete `_ are slow and have side-effects - How: ``shtab`` processes an ``argparse.ArgumentParser`` object to generate a tab completion script for your shell Features -------- - Outputs tab completion scripts for multiple shells - ``bash``, ``zsh``, ``fish``, ``tcsh``, ``powershell`` - Supports - `argparse `_ - `docopt `_ (via `argopt `_) - `click `_ - ````, ``--options`` and ``sub commands`` - Choices (``--say={hello,goodbye}``) - Paths (``--file={*.y*ml,*.toml}``, ``--dir=*/``) - Dynamic shell commands (``--branch=$(git branch)``) ------------------------------------------ .. contents:: Table of Contents :backlinks: top Installation ------------ Choose one of: - ``pip install shtab``, or - ``conda install -c conda-forge shtab`` See `operating system-specific instructions in the docs `_. Usage ----- There are two ways of using ``shtab``: - `CLI Usage `_: ``shtab``'s own CLI interface for external applications - may not require any code modifications whatsoever - end-users execute ``shtab your_cli_app.your_parser_object`` - `Library Usage `_: as a library integrated into your CLI application - adds a couple of lines to your application - argument mode: end-users execute ``your_cli_app --print-completion {bash,zsh,tcsh,fish,powershell}`` - subparser mode: end-users execute ``your_cli_app completion {bash,zsh,tcsh,fish,powershell}`` Examples -------- See `the docs for usage examples `_. FAQs ---- Not working? Check out `frequently asked questions `_. Alternatives ------------ All these execute the underlying script *every* time ```` is pressed (slow and have side-effects): - `argcomplete `_ - `pyzshcomplete `_ (only provides ``zsh`` completion) - `click `_ (don't want to migrate away from ``click``? Use ``shtab``'s one-liner click integration `in the CLI `_ or `in a library `_) Contributions ------------- Please do open `issues `_ & `pull requests `_! Some ideas: - support ``python -m`` prefix (`#55 `_) See `CONTRIBUTING.md `_ for more guidance. |git-fame| |Hits| .. |Logo| image:: https://github.com/tqdm/shtab/raw/main/meta/logo.png .. |Tests| image:: https://img.shields.io/github/actions/workflow/status/tqdm/shtab/test.yml?logo=github&label=tests :target: https://github.com/tqdm/shtab/actions :alt: Tests .. |Coverage| image:: https://codecov.io/gh/tqdm/shtab/branch/main/graph/badge.svg :target: https://codecov.io/gh/tqdm/shtab :alt: Coverage .. |Quality| image:: https://app.codacy.com/project/badge/Grade/0ce50da5c6e04236a891b092c7012753 :target: https://app.codacy.com/gh/tqdm/shtab/dashboard :alt: Quality .. |Conda| image:: https://img.shields.io/conda/v/conda-forge/shtab.svg?label=conda&logo=conda-forge :target: https://anaconda.org/conda-forge/shtab :alt: conda-forge .. |PyPI| image:: https://img.shields.io/pypi/v/shtab.svg?label=pip&logo=PyPI&logoColor=white :target: https://pypi.org/project/shtab :alt: PyPI .. |PyPI-Downloads| image:: https://static.pepy.tech/personalized-badge/shtab?left_text=downloads%2Fmonth :target: https://pepy.tech/project/shtab :alt: Downloads .. |git-fame| image:: https://git-fame.cdcl.ml/gh/tqdm/shtab?min=1&w=1&M=1&C=1&enum=1 :alt: git-fame :target: https://git-fame.cdcl.ml/gh/tqdm/shtab?w=1&M=1&C=1&enum=1 .. |Hits| image:: https://cgi.cdcl.ml/hits?q=shtab&style=social&r=https://github.com/tqdm/shtab&a=hidden :target: https://cgi.cdcl.ml/hits?q=shtab&a=plot&r=https://github.com/tqdm/shtab&style=social :alt: Hits .. |LICENCE| image:: https://img.shields.io/pypi/l/shtab.svg :target: https://raw.githubusercontent.com/tqdm/shtab/main/LICENCE