clickqt
clickqt generates Qt GUIs from click commands. Your click CLI remains the single source of truth, your users get the benefit from a GUI.
Feature List
- Build a GUI automatically from
clickCLIs - Launch GUIs for already installed CLIs (or from a Python file) via
clickqtfy. - Ship a GUI for your Python package with three lines of code
- Map common
clicktypes to Qt widgets, includingbool,int,float,str,Choice,DateTime,Path,File, tuple,nargs, andmultiple. - Support for hierarchically nested
click.Groups - Carry over defaults, required flags, callbacks, and envvar-based initialization.
- Execute your command from the GUI and stream stdout/stderr to an in-app terminal panel.
- Export the current GUI state as a shell command and import command lines from the clipboard.
- Support option grouping headers from
click-option-group.
Installation instructions
clickqt requires Python >=3.10.
Install from PyPI:
python -m pip install clickqt
Install from conda-forge:
conda install -c conda-forge clickqt
Install for local development:
python -m pip install --editable .[tests]
pre-commit install
Usage for end users (via clickqtfy)
Generate a GUI from an installed entry point:
clickqtfy ENTRYPOINT
Generate a GUI from a Python file and a click command object name:
clickqtfy path/to/module.py COMMAND_FUNCTION
In the generated GUI:
Runexecutes the current command.Stoprequests interruption of a running command.Copy-To-Clipboardexports the current command line.Import-From-Clipboardparses a command line and updates widgets.
Usage for library maintainers
Expose a GUI to your users via the qtgui_from_click function:
import click
from clickqt import qtgui_from_click
@click.command()
@click.option("--count", default=1, type=int)
@click.argument("name")
def greet(count: int, name: str) -> None:
for _ in range(count):
click.echo(f"Hello {name}")
greet_gui = qtgui_from_click(
greet,
application_name="Greeter",
invocation_command="greet",
)
Publish CLI and GUI entry points in pyproject.toml:
[project.scripts]
greet = "yourpkg.cli:greet"
[project.gui-scripts]
greet_gui = "yourpkg.cli:greet_gui"
For custom click.ParamType, provide a widget/getter/setter mapping:
from PySide6.QtWidgets import QLineEdit
custom_mapping = {
MyParamType: (
QLineEdit,
lambda w: w.widget.text(),
lambda w, v: w.widget.setText(str(v)),
)
}
gui = qtgui_from_click(cmd, custom_mapping=custom_mapping)
Constraints
- Unknown custom
click.ParamTypefalls back to a text field unless you providecustom_mapping. click-option-groupis displayed visually, but group relationship rules are not enforced byclickqt.- Parameters with
hidden=Trueare currently still rendered in the GUI. clickqtexecutes command callbacks directly; advanced customclick.Command/click.Contextbehavior may differ from CLI invocation.- Multi-value envvar handling can differ from Click's type-specific envvar splitting behavior.
Licensing
MIT License. See LICENSE.md.
Release files for clickqt 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| clickqt-1.0.0.tar.gz | 98.3 kB | Details |
Release files / clickqt-1.0.0.tar.gz
| Download URL | clickqt-1.0.0.tar.gz |
|---|---|
| Size | 98.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ec4d6a10e8ce1a3200f63b464c0c579c1ed59cfb88a19cc2ade3aecd7a53b47
|
|
BLAKE2b-256 checksum How to use checksums |
5fb2d43be606aa9ec22c86c7747f1339c89637d3917dfd684432c0d78ac52fd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 26, 2026.
Transparency log