Metadata-Version: 2.4
Name: dygo
Version: 0.2.0
Summary: Dynamic Gooey from config files
Project-URL: Documentation, https://github.com/m-birke/dygo#readme
Project-URL: Issues, https://github.com/m-birke/dygo/issues
Project-URL: Source, https://github.com/m-birke/dygo
Author-email: Birkenbach Marius <wesci@web.de>
License-File: LICENSE.txt
Keywords: gooey,gui,json,jsonpath,yaml
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.7
Requires-Dist: dpath
Requires-Dist: gooey
Requires-Dist: jsonpath-ng
Requires-Dist: pyyaml
Description-Content-Type: text/markdown

# `dygo` - Dynamic Gooey

[![PyPI - Version](https://img.shields.io/pypi/v/dygo.svg)](https://pypi.org/project/dygo)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dygo.svg)](https://pypi.org/project/dygo)

-----

**Table of Contents**

- [About](#about)
- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

## About

Dynamic Gooey (`dygo`) ...

1. Parses config files (json or yaml)
1. Extracts values which have to be defined by the user during runtime
1. Renders a GUI via [Gooey](https://github.com/chriskiehl/Gooey)
1. Let the user insert the values for the dynamic parameters
1. Inserts the received entries into the config
1. Returns the config

## Installation

```console
pip install dygo
```

## Usage

```python
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

    ```yaml
    my_dynamic_param:
        dygo: 'room for a comment here'
        dest: 'param1'
    ```

- json

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

The rendered GUI looks like this:

![example](img/example.png)

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](https://github.com/chriskiehl/Gooey) for further documentation). Most important is the `dest` arg whose value will be displayed as a name of the parameter for the user.

## License

`dygo` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
