Skip to main content

Dynamic Gooey from config files

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dygo-0.3.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file dygo-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: dygo-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.25.0

File hashes

Hashes for dygo-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1cdea31a5dfb3de22368e420c3ef3de934cc3d9d261ac5a13d01308a3875e3d1
MD5 6bc74b8e547e2f0596ec17b0023862ef
BLAKE2b-256 e19c14f2b154fc895f8102dc4d9f902df54c1f52f113531fcfa73c30b4da0cbb

See more details on using hashes here.

Supported by

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