Skip to content

m-birke/dygo

Repository files navigation

dygo

Version PyPI - Version PyPI - Python Version
Project GitHub License PyPI - Status PyPI - Format PyPI - Implementation
CI GitHub Actions Workflow Status
Code PyPI - Types Checked with mypy Linting: Ruff Code style: black

Dynamic Gooey from config files

Table of Contents

About

Dynamic Gooey (dygo) ...

  1. Parses config files (json or yaml)
  2. Extracts values which have to be defined by the user during runtime
  3. Renders a GUI via Gooey
  4. Let the user insert the values for the dynamic parameters
  5. Inserts the received entries into the config
  6. Returns the config

Installation

pip install dygo

Usage

from dygo import render

my_cfg = render("path/to/jsonORyaml")

The dynamic key needs to be inserted as a dict into the config file. The following two examples do the exact same.

  • yaml

    my_dynamic_param:
        dygo: 'room for a comment here'
        dest: 'param1'
  • json

    "my_dynamic_param": {"dygo": "dygo", "dest": "param1"},

The rendered GUI looks like this:

example

The dict will be replaced with the value received from the user. Assuming the user entered abc for param1, the dict afterwards looks like {"my_dynamic_param": "abc"}.

Currently the key dygo serves as a flag for Dynamic Gooey to detect dynamic parameters (the value is ignored). All other key-value pairs in the dygo dict are treated as args for GooeyParser.add_argument (see Gooey for further documentation). Most important is the dest arg whose value will be displayed as a name of the parameter for the user.

Setting the Program Name & Description

from dygo.config import set_program_metadata

set_program_metadata(program_name="My Program", program_description="It does what it does")

License

dygo is distributed under the terms of the MIT license.

About

Dynamic Gooey composing from config files

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors