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 |
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
- 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
Release history Release notifications | RSS feed
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.2.tar.gz
(56.4 kB
view hashes)
Built Distribution
Close
Hashes for argparse_tui-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e3430ead474d2141170a763657a44c3a8ceeb19ac0b90c9c22f527af1c2d55d |
|
MD5 | 8e7cc4952a2ad8f369b4517998714570 |
|
BLAKE2b-256 | f307b75985b8fe1847444e12cb4aa75f7e5cdb8decd3d42e3f12ac926ede2276 |