A tool that will GUI-ify your functions
Project description
GUIfy
Simplest form of GUI for automation scripts.
Made with eel as python backend and react used as frontend.
How to use
pip install guify
# main.py
import GUIfy from guify
# Instantiate the app, variables are optional.
app = GUIfy(app_name='GUIfy', port=8080) # default app_name is 'GUIfy'
# Register the function "test_1"
# All variables are optional
# name - the name of the "test" in the gui
# priority - Sets the order of the tests, priority 0 will run before priority 1
# description - the small text description under the test's name in the gui.
@app.register(name='Test 1', priority=0, description='This is a test')
# Define the test, each argument that "test_1" requires will be automatically prompted for in the gui.
# if same arg name (example_arg) apperas on 2 different tests, it will be requested only once in the gui.
def test_1(example_arg):
# app.monitor object represents the textarea on the right-hand side of the gui
# app.monitor.clear_text() - sets the text to empty string
app.monitor.clear_text()
# app.monitor.set_text(text) - sets the text to whatever is passed to it
app.monitor.set_text('This is a test\n')
# app.monitor.append_text(text) - appends whatever passed to it to the textarea
app.monitor.append_text('This is a test2\n')
# app.prompt_user(prompt) - pops up a modal in the gui and asks user to click OK or cancel.
# app.prompt_user will return True if user clicked OK and False if user clicked cancel
result = app.prompt_user('This is a prompt') # True if user clicked OK, False if user clicked Cancel
# app.config get something from config tab, acts similar to configparser
# config stored in config.ini in the current working directory.
foo = app.config.get('example','foo') # == bar
# Specify the return type, this is used for report generation
# if function returns True then test considered as Passed
# if function returns False then test considered as Failed
return True
# this test will be registered after test_1, because its priority arg is higher.
@app.register(name='Test 2', priority=1, description='This is the second test.')
def test_2(example_arg, second_arg):
app.monitor.clear_text()
app.run()
Monitor object
app.monitor is the monitor object representing the preview window on right hand side of the GUI,
- set_text(text: str) -> None // will set the text in the monitor to whatever passed in "text" argument
- append_text(text: str) -> None // will append the next to the monitor
- clear_text(text: str) -> None // will clear all text in the monitor
Config tab
"app.config" is an object representing the config tab. All configurations are stored in config.ini.
app.config methods:
- save() // Save config to config.ini
- load() // Load config from config.ini
- get_section() // load() and return an entire section as a dictionary
- get(section, attribute) // load() and get value of attribute in section
- set(section, attribute, value) // load() and set value of attribute in section and then save().
Assuming this is the config file:
[example]
foo = bar
This will be the correct usage of app.config object
app.config.get_section('example') -> {'foo': 'bar'}
app.config.get('example', 'foo') -> 'bar'
Settings
in settings.ini you can change the following settings:
- reports_dir - Optional defualt is "reports/" the directory where the reports will be saved
- report_name_prefix - Optional: Can be one of the variables passed to registered functions, uses this variable name as identification for reports
Building
Theoretically its possible to build an executable with eel using the following:
py -m eel index.py build --onefile --noconsole --name <whatever_u_want> --icon=public/favicon.ico
Please not that this hasn't been tested yet.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file guify-0.2.5a5.tar.gz.
File metadata
- Download URL: guify-0.2.5a5.tar.gz
- Upload date:
- Size: 379.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f811fe1da1d44cc32b218887b1a2a95333aef2802217dce2b67923341426115f
|
|
| MD5 |
9cce35912c2fb5eb8077667f841b808d
|
|
| BLAKE2b-256 |
b043d6857fac7f3d57e3ac158c7c7893bb8496067e5eeb3bc7ed8d16ceab387d
|
File details
Details for the file guify-0.2.5a5-py3-none-any.whl.
File metadata
- Download URL: guify-0.2.5a5-py3-none-any.whl
- Upload date:
- Size: 382.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14aa2a0164fb72e4627706a4dcd599e2938ca9f07cf5bb1a7760f152e614500e
|
|
| MD5 |
de47981035ac08db155ab835f8f47559
|
|
| BLAKE2b-256 |
d7edb60917c4217b38cafeea73ff48f23a8d965db5f09c46a55ad36c09e97b5a
|