consolekit

Additional utilities for click.

Docs

Documentation Build Status Docs Check Status

Tests

Linux Test Status Windows Test Status macOS Test Status Coverage

PyPI

PyPI - Package Version PyPI - Supported Python Versions PyPI - Supported Implementations PyPI - Wheel

Anaconda

Conda - Package Version Conda - Platform

Activity

GitHub last commit GitHub commits since tagged version Maintenance PyPI - Downloads

QA

CodeFactor Grade Flake8 Status mypy status

Other

License GitHub top language Requirements Status

Installation

python3 -m pip install consolekit --user

Additionally, for better support in terminals, install psutil by specifying the terminals extra:

python -m pip install consolekit[terminals]

or, if you installed consolekit through conda:

conda install -c conda-forge psutil

Highlights

choice(
  options: Union[List[str], Mapping[str, str]],
  text: str = '',
  default: Optional[str] = None,
  prompt_suffix: str = ': ',
  show_default: bool = True,
  err: bool = False,
  start_index: int = 0,
  ) -> Union[str, int]

Prompts a user for input.

See more in consolekit.input.

MarkdownHelpCommand(
  name: Optional[str],
  context_settings: Optional[Dict[str, Any]] = None,
  callback: Optional[Callable[..., Any]] = None,
  params: Optional[List[Parameter]] = None,
  help: Optional[str] = None,
  epilog: Optional[str] = None,
  short_help: Optional[str] = None,
  options_metavar: Optional[str] = '[OPTIONS]',
  add_help_option: bool = True,
  no_args_is_help: bool = False,
  hidden: bool = False,
  deprecated: bool = False,
  )

Subclass of click.Command which treats the help text as markdown and prints a rendered representation.

See more in consolekit.commands.

auto_default_option(
  *param_decls,
  **attrs,
  ) -> Callable[[~_C], ~_C]

Attaches an option to the command, with a default value determined from the decorated function’s signature.

See more in consolekit.options.

SuggestionGroup(
  name: Optional[str] = None,
  commands: Union[Dict[str, Command], Sequence[Command], None] = None,
  **attrs: Any,
  )

Subclass of click.Group which suggests the most similar command if the command is not found.

See more in consolekit.commands.