Skip to main content

ezgooey: Create GUIs for CLI Apps Effortlessly

ezgooey is a Python utility that adds a GUI to argparse-based CLI applications. It uses Gooey under the hood, switching between GUI and CLI modes automatically based on whether command-line arguments are provided.

It also includes a logging module with colored output that works in both terminal and GUI environments.

Who is ezgooey for?

Python developers who:

  • Already use argparse for CLI apps
  • Want a GUI option without rewriting argument parsing
  • Need to support both GUI and CLI users from one script
  • Want better-looking logs in both environments

Key Features

  • One decorator: Add @ezgooey to your parser function
  • Automatic mode switching: GUI when no args given, CLI otherwise
  • Drop-in replacement: Works with existing argparse code
  • Colored logging: Enhanced output for both terminal and Gooey
  • Full Gooey support: All Gooey decorator options work unchanged

Installation

pip install ezgooey

Installs Gooey, wxPython, and colored as dependencies.

Usage

1. ezgooey.ez: Adding GUI to your CLI

Add the @ezgooey decorator to your ArgumentParser function:

from argparse import ArgumentParser
from ezgooey.ez import ezgooey

@ezgooey
def create_my_parser():
    parser = ArgumentParser(
        prog='my_app',
        description='This is a demonstration app.'
    )
    parser.add_argument(
        'filename',
        help='Path to the input file',
        widget='FileChooser'
    )
    parser.add_argument(
        '-v', '--verbose',
        action='store_true',
        help='Enable verbose output'
    )
    return parser

if __name__ == '__main__':
    parser = create_my_parser()
    args = parser.parse_args()

    if args.verbose:
        print("Verbose mode enabled.")
    print(f"Processing file: {args.filename}")

Behavior:

  • python script.py → Opens GUI
  • python script.py file.txt -v → Runs as CLI
  • The decorator handles all conditional logic

Advanced example with Gooey options:

from argparse import ArgumentParser
from ezgooey.ez import ezgooey

GUI_NAME = 'My Advanced GUI App'
CLI_NAME = 'mycli'

@ezgooey(
    program_name=GUI_NAME,
    default_size=(800, 600),
    navigation='Tabbed',
    menu=[{
        'name' : 'Help',
        'items': [{
            'type': 'AboutDialog',
            'menuTitle': 'About',
            'name': GUI_NAME,
            'description': 'An example application using ezgooey.',
            'website': 'https://github.com/twardoch/ezgooey',
            'license': 'MIT'
        }]
    }]
)
def get_advanced_parser():
    parser = ArgumentParser(
        prog=CLI_NAME,
        description='An advanced application with multiple options.'
    )

    group1 = parser.add_argument_group(
        'Input/Output',
        gooey_options={'columns': 1, 'show_border': True}
    )
    group1.add_argument(
        '--input-file',
        widget='FileChooser',
        help='File to process',
        gooey_options={'wildcard': "Text files (*.txt)|*.txt"}
    )
    group1.add_argument(
        '--output-dir',
        widget='DirChooser',
        help='Directory to save results'
    )

    group2 = parser.add_argument_group(
        'Settings',
        gooey_options={'columns': 2}
    )
    group2.add_argument(
        '--iterations',
        type=int,
        default=10,
        help='Number of iterations to run'
    )
    group2.add_argument(
        '--mode',
        choices=['fast', 'slow', 'balanced'],
        default='balanced',
        help='Processing mode'
    )
    return parser

if __name__ == '__main__':
    parser = get_advanced_parser()
    args = parser.parse_args()
    print(f"Input: {getattr(args, 'input_file', 'N/A')}, Output Dir: {getattr(args, 'output_dir', 'N/A')}")
    print(f"Iterations: {args.iterations}, Mode: {args.mode}")

See Gooey documentation for all decorator options.

2. ezgooey.logging: Colored, GUI-friendly logs

# Initialize once at app start
import ezgooey.logging as logging
logging.init(level=logging.INFO)

# Use anywhere in your code
import logging
logging.info('This is an info message.')
logging.warning('This is a warning.')
logging.error('This is an error!')
logging.success('Operation completed successfully!')  # Custom level

Named loggers for larger applications:

# At app start
import ezgooey.logging as ez_logging
ez_logging.init(level=ez_logging.INFO)

# In other modules
import ezgooey.logging as ez_logging
log = ez_logging.logger('my_module_name')

log.info('Info message from my_module.')
log.warning('Warning from my_module.')
log.success('Task in my_module succeeded.')

Log levels: Standard levels plus SUCCESS for positive feedback. Output is color-coded by severity.

How It Works

ezgooey.ez

  1. Conditional import: Imports gooey only when needed
  2. Mode detection: Uses GUI mode when Gooey is available and no CLI args given
  3. Monkey-patching: Extends argparse methods to accept Gooey-specific options (widget, gooey_options) without breaking CLI mode

Example: parser.add_argument(..., widget='FileChooser') works in both modes.

ezgooey.logging

Configures Python's standard logging with:

  • Colored output using the colored library
  • Rich text formatting compatible with Gooey's console
  • Unbuffered output for immediate GUI feedback
  • Custom SUCCESS level with green text
  • init() function for one-time setup
  • logger() function that adds success() method to loggers

Project Structure

ezgooey/
├── ezgooey/
│   ├── __init__.py   # Package initialisation, version
│   ├── ez.py         # Core decorator logic, monkey-patching
│   └── logging.py    # Colored logging setup
├── tests/
│   ├── test_ez.py
│   ├── test_integration.py
│   ├── test_logging.py
│   └── test_version.py
├── docs/
│   └── index.md      # Jekyll documentation site
├── pyproject.toml    # Build (hatchling + hatch-vcs), ruff, mypy, pytest config
├── README.md         # This file
├── CHANGELOG.md      # Version history
└── LICENSE           # MIT license

Dependencies

Installed automatically with pip.

Contributing

Issues and pull requests welcome at GitHub repository.

Development Setup

pip install hatch
hatch env create
hatch run pytest          # run test suite (29 tests)
hatch run ruff check .    # lint
hatch run mypy ezgooey/   # type-check

Building

hatch build               # produces sdist + wheel in dist/

Version History

See CHANGELOG.md and GitHub Releases.

License

MIT License. Copyright © 2020-2023 Adam Twardoch.

Metadata

Release files for ezgooey 2.7.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ezgooey 2.7.8
File Size Uploaded Provenance Actions
ezgooey-2.7.8.tar.gz 15.1 kB With provenance Details for ezgooey-2.7.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ezgooey 2.7.8
File Interpreter ABI Platform Actions
ezgooey-2.7.8-py3-none-any.whl Python 3 none any Details for ezgooey-2.7.8-py3-none-any.whl

Total release size: 24.3 kB

Release files / ezgooey-2.7.8.tar.gz

Download URL ezgooey-2.7.8.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
56f7dda1896fc8e071aac0ee7194ecfcdc286e46286f43c82220ea2f6f29614c
BLAKE2b-256 checksum
How to use checksums
80dbfaa45ddce75975cfe13d630d49c0088560eeb06b696100d0094d19096d13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / ezgooey-2.7.8-py3-none-any.whl

Download URL ezgooey-2.7.8-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b0a76925911e5b47f05866415ffcd4eaaf0a4e94a22644d7c9643956288b6fc
BLAKE2b-256 checksum
How to use checksums
33d8a46283adc481234ac4e270641425f1b8d4c50500c06ced84eb534c1e8e1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for ezgooey 2.7.8

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ezgooey-2.7.8.tar.gz

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 Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page