Skip to main content

Display your Python argparse CLI as a TUI.

Project description

argparse-tui

Display your Python argparse CLI as a TUI.

Links
Code Repo https://www.github.com/fresh2dev/argparse-tui
Mirror Repo https://www.f2dv.com/code/r/argparse-tui
Documentation https://www.f2dv.com/code/r/argparse-tui/i
Changelog https://www.f2dv.com/code/r/argparse-tui/i/changelog
License https://www.f2dv.com/code/r/argparse-tui/i/license
Funding https://www.f2dv.com/fund

GitHub release (latest SemVer) GitHub Release Date License GitHub issues GitHub pull requests GitHub Repo stars PyPI - Downloads Docs Website Coverage Website Funding


Overview

This is a fork of the Textualize Trogon TUI library that introduces these features:

  • add support for Python's argparse parsers
  • remove support for Click
  • add ability for TUI parameter to filter subcommands
  • support for manually constructing schemas
  • support for argparse
  • add examples for yapx, myke, and sys.argv
  • support ommission of hidden parameters and subcommands from the TUI
  • support the redaction of sensitive "secret" values
  • support for showing required prompts as read-only
  • positional arguments come before keyword arguments in the generated command
  • ability to join list arguments values like this: -x 1 -x 2 -x 3 (default), or like this: -x 1 2 3
  • vim-friendly keybindings

Install

Install from PyPI:

pip install argparse-tui

Use

import arparse
from argparse_tui import add_tui_argument, add_tui_command

parser = argparse.ArgumentParser()

# Add tui argument (my-cli --tui)
add_tui_argument(parser, option_strings=["--tui"], help="Open Textual UI")

# Or, add tui command (my-cli tui)
add_tui_command(parser, command="tui", help="Open Textual UI")

parser.print_help()

Docs

See more examples in the reference docs.

Support

Brought to you by...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

argparse-tui-0.1.0.tar.gz (56.2 kB view hashes)

Uploaded Source

Built Distribution

argparse_tui-0.1.0-py3-none-any.whl (65.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page