Skip to main content

Graphical User Interface for Click

Project description

guick : a Graphical User Interface for CLI using click

Introduction

guick (Graphical User Interface Creation Kit) can transform your command line interface (CLI) into a graphical user interface (GUI) with just a few lines of code.

guick is built on top of click and wxPython.

Please note that for the moment the package can only handle click command (and not group).

Installation

pip install guick

How does it work

Just add cls=CommandGui to your click.command, and guick will transform your Command Line Interface into a Graphical User Interface:

   @click.command(cls=CommandGui)
   @click.option("--arg_text", help="arg_text", type=click.STRING, required=True)
   @click.option("--arg_int", help="arg_int", type=click.INT, required=True)
   @click.option("--arg_float", help="arg float", type=click.FLOAT, required=True)
   @click.option("--arg_bool", type=click.BOOL, required=True)
   @click.option("--arg_uuid", type=click.UUID, required=True)
   @click.option("--arg_filepath", type=click.Path(file_okay=True, exists=True), required=True)
   @click.option("--arg_dir", type=click.Path(dir_okay=True, exists=True), required=True)
   @click.option("--arg_choice", type=click.Choice(["choice1", "choice2"]), required=True)
   @click.option("--arg_int_range", type=click.IntRange(min=1, max=4), required=True)
   @click.option("--arg_float_range", type=click.FloatRange(min=1, max=4), required=True)
   @click.option("--arg_passwd", type=click.STRING, hide_input=True)
   def main(
       arg_text,
       arg_int,
       arg_float,
       arg_bool,
       arg_uuid,
       arg_file,
       arg_filepath,
       arg_dir,
       arg_choice,
       arg_int_range,
       arg_float_range,
       arg_passwd
    ):
       print(arg_text, arg_int, arg_float, arg_bool, arg_uuid, arg_filepath, arg_dir, arg_choice, arg_int_range, arg_float_range, arg_passwd)
   
   if __name__ == "__main__":
       main()

Support most of standard click types

  • bool options are rendered as CheckBox,
  • click.Choice options are rendered as ComboBox,
  • click.Path options are rendered as FileDialog (with Drag & Drop support)
  • text entries for string options with hide_input=True are hidden (useful for password)
  • all other option types (including custom types) are rendred as normal text entry

[!NOTE]

  • Multi value options (using nargs) or tuples as option types are not yet supported.
  • Multiple options (using multiple=True) are not yet supported.
  • click.File type is not yet supported
  • click.argument are not yet supported

Using default values if any

Take into account default values for options if they are defined

History

Keeping track of the last values of options: options fields are prefilled using the option values from the previous run

Separate required / optional options

The required and optional options are seperated in the GUI to clearly see what are the mandatory options

With validtation

Taking advantage of click validation rules, if an option doesn't pass the validation, a red text will be shown, explaining the error.

Standard output is redirected to the GUI

...with basic support of colorized Terminal log

Automatically creates an Help menu

With hyperlink if URL is detected, enabling to go directly to the html documentation pages

Automatically handles --version option

By adding a About section in the Help menu

Support group options using notebook

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

guick-0.0.2.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

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

guick-0.0.2-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file guick-0.0.2.tar.gz.

File metadata

  • Download URL: guick-0.0.2.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.15

File hashes

Hashes for guick-0.0.2.tar.gz
Algorithm Hash digest
SHA256 aaa4ee44323215fc0ee92dba1b715700bc053b1c656e661d54c6fbc192a0fb35
MD5 24c43352eb97ee4796fb18dcd1737f5c
BLAKE2b-256 7ff922f56ec9c188bbd37a5b83191aa3514d5217aca13ea922e2fa4a5b54a597

See more details on using hashes here.

File details

Details for the file guick-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: guick-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.15

File hashes

Hashes for guick-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 18fc7d3bebf36e9528530c0f5b0a17fe21ad93082e1cdf1643275b4932d8af0f
MD5 22d5187fc48de8c0457584d0602b13ac
BLAKE2b-256 9ad4f9eebb3cc976be5c56b485d4dc719e1f79abe953a115f84e85e7c0c2ae01

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