Skip to main content

An automatic, terminal based interactive interface for any Python 3 `argparse` command line with keyboard and mouse support.

Project description

ArgUI

ArgUI's Logo

An automatic, terminal based interactive interface for any Python 3 argparse command line with keyboard and mouse support.


See It in Action

Demo of the features in ArgUI

Get a feel for the features of ArgUI using the Demo.py code included in this project.

Usage

Install as a Dependency

The ArgUI package is available on PyPi.

It can be installed by calling: pip install Argparse-Interface

Setup Your Argparse

ArgUI supports wrapping any implementation of the Python 3 argparse native library. This will all you to use both standard terminal and interface modes to interact with your program.

# Import
import argparse
import argui

# Setup your ArgumentParser normally
parser = argparse.ArgumentParser(prog="Demo")

# `add_argument`, `add_argument_group`, etc...

# Wrap your parser
interface = argui.Wrapper(parser)

# Get arguments
args: argparse.Namespace = interface.parseArgs()

# `args` is the same as if you had called `parser.parse_args()`

See Demo.py for more information.

Run Your Program

Your program can now be run in both CLI and GUI modes.

To run in CLI mode, simply use your script as normal like python foo.py -h.

To run in GUI mode, provide only the --gui (by default) argument like python foo.py --gui.

Navigation

Mouse navigation of the GUI is possible in most terminals.

There are known issues with the VSCode terminal on Windows 10 and some others. However, Mouse navigation does work in Powershell when opened on its own.

Keyboard navigation is always available using Tab, Arrow Keys, and Enter. But make note that if you are using a terminal within another program (like VSCode), that some more advanced keyboard commands (like CTRL+S) may be captured by the container program and not sent to the GUI.

Development Setup

  1. Clone this repo and enter the directory with a terminal.
  2. Setup a Python Env: python -m venv .venv --prompt "argUI"
  3. Enter the Python Env.
  4. Install requirements: pip install -r requirements.txt

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-Interface-0.1.2.tar.gz (17.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

argparse_interface-0.1.2-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

Argparse_Interface-0.1.2-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file Argparse-Interface-0.1.2.tar.gz.

File metadata

  • Download URL: Argparse-Interface-0.1.2.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.5

File hashes

Hashes for Argparse-Interface-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d2cf51ca110459d11f22ac502f2c367071958d6a319b331ba2c50c7a202ea8bc
MD5 e3dd232192fb3b03ad7f6086b3f82b76
BLAKE2b-256 8e00003fbe7cad056e74050b6d1cdd52d3c87951668d99de8b3fed487d756f8b

See more details on using hashes here.

File details

Details for the file argparse_interface-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for argparse_interface-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9fee9b5778ae802bed3392bf9ca390b64fb436c1898bb9de051715d2aa962e09
MD5 c69e8486160cf43796f3d6eaafa84d64
BLAKE2b-256 23b3ef2b924ac7b387f8ca1903de7cd90a5bf7049e7a4a3bb28df29abf6c7c4e

See more details on using hashes here.

File details

Details for the file Argparse_Interface-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for Argparse_Interface-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 01ebe9e6cdc4c4988b92a399c9612dabef45dc741638b39177a28fb0c8e8ca71
MD5 115ec5bb94bcc26a3d9ee96db3170586
BLAKE2b-256 43efaa8511aaa7655fea5b88db9c60aa7ec595f8bfc0c5f74df0368aa9f64097

See more details on using hashes here.

Supported by

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