Skip to main content

Simplifies making GUI+CLI apps with Gooey

Project description

ezgooey

ezgooey.ez

Gooey is a Python package, which lets you turn argparse-based CLI apps into cross-platform GUI apps. ezgooey.ez makes this even simpler.

When you start your app without CLI arguments, it’ll run in GUI, but if you supply CLI arguments, it’ll run as CLI. Import, then add the @ezgooey decorator to the function where you initialize the ArgumentParser.

Simple

from ezgooey.ez import *

@ezgooey
def get_parser():
    parser = ArgumentParser(
        prog='appname',
        description='app description'
    )
...

Advanced

from ezgooey.ez import *

GUI_NAME = 'GUI App Name'
CLI_NAME = 'cliapp'

@ezgooey(
    advanced=True,
    auto_start=False,
    default_size=(800, 600),
    disable_progress_bar_animation=False,
    disable_stop_button=False,
    dump_build_config=False,
    group_by_type=True,
    header_height=80,
    hide_progress_msg=False,
    image_dir='::gooey/default',
    language='english',
    language_dir=getResourcePath('languages'),
    load_build_config=None,
    monospace_display=False,
    navigation='Tabbed',
    optional_cols=1,
    program_description=None,
    program_name=GUI_NAME,
    progress_expr=None,
    progress_regex=None,
    required_cols=1,
    richtext_controls=True,
    suppress_gooey_flag=True,
    tabbed_groups=False,
    target=None,
    use_legacy_titles=True,
    menu=[{
        'name' : 'Help',
        'items': [{
            'type'       : 'AboutDialog',
            'menuTitle'  : 'About',
            'name'       : GUI_NAME,
            'description': 'Click the link for more info',
            'website'    : 'https://your.link/',
            'license'    : 'MIT'
        }, {
            'type'     : 'Link',
            'menuTitle': '%s Help' % (GUI_NAME),
            'url'      : 'https://your.link/docs/'
        }]
    }]
    )
def get_parser():
    parser = ArgumentParser(
        prog=CLI_NAME,
        description='app description'
    )
...

The @ezgooey decorator uses the same arguments as the original @Gooey decorator. `See Gooey documentation for a detailed description.

ezgooey.logging

This package also includes a simple colorful logger that is compatible with Gooey's richtext control.

Simple usage

Import and initialize in one place

import ezgooey.logging as logging
logging.init(level=logging.INFO)

Use

logging.info('info')
logging.warning('warning')
logging.error('error')
logging.success('success')

In other places, just do:

import logging
logging.info('info')

Advanced usage

Import and initialize in one place

import ezgooey.logging as logging
logging.init(level=logging.INFO)

In other places:

import ezgooey.logging as logging
log = logging.logger('appname')
log.info('info')
log.warning('warning')
log.error('error')
log.success('success')
...

Example

My PyPolona project is an app, made with the help of ezgooey and packaged for macOS and Windows with PyInstaller. Check the sources for details.

Requirements

Requires Python 3.8+

License and Copyright

Copyright © 2020 Adam Twardoch. Licensed under the terms of the MIT license.

<script async defer src="https://buttons.github.io/buttons.js"></script>

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

ezgooey-1.2.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

ezgooey-1.2.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file ezgooey-1.2.1.tar.gz.

File metadata

  • Download URL: ezgooey-1.2.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for ezgooey-1.2.1.tar.gz
Algorithm Hash digest
SHA256 4332832a0250dd0d4a07cb14df9299598824c3810746172232e1cff406cb3e95
MD5 4eda2d0fad1a3ecabfc8aea10e24f0c1
BLAKE2b-256 807e0bda046c1988fb1fc1d9d6d1b0bd138eb7e6ee64b87f249304ec77785547

See more details on using hashes here.

Provenance

File details

Details for the file ezgooey-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: ezgooey-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for ezgooey-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 52617ce377c2186d6940974922b3f87ab11415e19f9ce4c00e63f23fcfc0f749
MD5 30e8ebc4b61d7e26de08f157566d5f04
BLAKE2b-256 114f2664718e40e766a343a3358775fb68aebe63bfa459f55800986476c7a9d6

See more details on using hashes here.

Provenance

Supported by

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