experimental/cpu/: shtab-1.7.1 metadata and description

Simple index

Automagic shell tab completion for Python CLI applications

author_email Casper da Costa-Luis <casper.dcl@physics.org>
classifiers
  • Development Status :: 5 - Production/Stable
  • Environment :: Console
  • Environment :: MacOS X
  • Environment :: Other Environment
  • Intended Audience :: Developers
  • Intended Audience :: Education
  • Intended Audience :: End Users/Desktop
  • Intended Audience :: Other Audience
  • Intended Audience :: System Administrators
  • License :: OSI Approved :: Apache Software License
  • Operating System :: MacOS
  • Operating System :: MacOS :: MacOS X
  • Operating System :: POSIX
  • Operating System :: POSIX :: BSD
  • Operating System :: POSIX :: BSD :: FreeBSD
  • Operating System :: POSIX :: Linux
  • Operating System :: POSIX :: SunOS/Solaris
  • Operating System :: Unix
  • Programming Language :: Other Scripting Engines
  • Programming Language :: Python
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3.7
  • Programming Language :: Python :: 3.8
  • Programming Language :: Python :: 3.9
  • Programming Language :: Python :: 3.10
  • Programming Language :: Python :: 3.11
  • Programming Language :: Python :: 3 :: Only
  • Programming Language :: Python :: Implementation
  • Programming Language :: Python :: Implementation :: IronPython
  • Programming Language :: Python :: Implementation :: PyPy
  • Programming Language :: Unix Shell
  • Topic :: Desktop Environment
  • Topic :: Education :: Computer Aided Instruction (CAI)
  • Topic :: Education :: Testing
  • Topic :: Office/Business
  • Topic :: Other/Nonlisted Topic
  • Topic :: Software Development
  • Topic :: Software Development :: Build Tools
  • Topic :: Software Development :: Libraries
  • Topic :: Software Development :: Libraries :: Python Modules
  • Topic :: Software Development :: Pre-processors
  • Topic :: Software Development :: User Interfaces
  • Topic :: System
  • Topic :: System :: Installation/Setup
  • Topic :: System :: Shells
  • Topic :: System :: System Shells
  • Topic :: Terminals
  • Topic :: Utilities
description_content_type text/x-rst
keywords tab,complete,completion,shell,bash,zsh,argparse
license Apache-2.0
maintainer_email Iterative <support@iterative.ai>
project_urls
  • documentation, https://docs.iterative.ai/shtab
  • repository, https://github.com/iterative/shtab
  • changelog, https://github.com/iterative/shtab/releases
provides_extras dev
requires_dist
  • pytest >=6 ; extra == 'dev'
  • pytest-cov ; extra == 'dev'
  • pytest-timeout ; extra == 'dev'
requires_python >=3.7
File Tox results History
shtab-1.7.1-py3-none-any.whl
Size
14 KB
Type
Python Wheel
Python
3

Logo

shtab

Downloads Tests Coverage PyPI conda-forge

  • 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

    • bash

    • zsh

    • tcsh

  • Supports

  • Supports arguments, options and subparsers

  • Supports choices (e.g. --say={hello,goodbye})

  • Supports file and directory path completion

  • Supports custom path completion (e.g. --file={*.txt})


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}

    • subparser mode: end-users execute your_cli_app completion {bash,zsh,tcsh}

Examples

See the docs for usage examples.

FAQs

Not working? Check out frequently asked questions.

Alternatives

  • argcomplete

    • executes the underlying script every time <TAB> is pressed (slow and has side-effects)

    • only provides bash completion

  • pyzshcomplete

    • executes the underlying script every time <TAB> is pressed (slow and has side-effects)

    • only provides zsh completion

  • click

    • different framework completely replacing the builtin argparse

    • solves multiple problems (rather than POSIX-style “do one thing well”)

Contributions

Please do open issues & pull requests! Some ideas:

  • support fish

  • support powershell

See CONTRIBUTING.md for more guidance.

Hits