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
- 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
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.0.tar.gz
(56.2 kB
view hashes)
Built Distribution
Close
Hashes for argparse_tui-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1680201b3214cb9dc61dbad143404a84e3a4fb6d77571d2005300626e9de4ec |
|
MD5 | 25548162edb13ab0004b640e80b368a8 |
|
BLAKE2b-256 | f1720128087f2200783062ac5a6244e0d3b521866d876e320c9a01b8eb271946 |