GuiGen
Project description
GUI Generator
Are you lazy programmer who wants to have GUIs for his apps but does not want to create one for each app individually? Don't worry so am I. That's why I've spent couple of hours working on automatic GUI generator, instead of creating basic copy-paste GUI in 30 minutes.
The rules are simple:
- Make one function for each process you want to have.
- Register this function as
Processclass. - Register all instances of
ProcessinAppclass instance. - Use
app.build()and after a little bit of waiting a GUI will pop up!
Is it slow? Perhaps.
Does it work for complex apps? Nope.
Will it fail you once upon a time? Maybe.
Was it "tHorOUgHly TEstEd"? Hell nah.
Is it easy to use? Can it gather all your small scripts in one elegant GUI? Will it save you from going insane while trying to center a div? Very much yes, sir!
Example use case 1
from gui_gen import App, Process, arguments
from time import sleep
from datetime import datetime
def my_proc(
a1: arguments.Argument,
a2: arguments.Float,
a3: arguments.Int,
a4 = 1
):
sleep(10)
return datetime.now()
pr = Process(
my_proc
)
class CustomRegex(arguments.Regex):
pattern = r'[\d]*'
def my_proc2(
a1: arguments.Argument,
a2: arguments.Float,
text: CustomRegex,
ch1: arguments.Choice,
ch2: arguments.Choice = [1, 2, 3],
d: arguments.Date = datetime(2021, 3, 7).date(),
dt: arguments.DateTime = datetime(2021, 1, 12, 10, 21),
a3: arguments.Int = 2,
a4: arguments.Boolean = False,
a5: arguments.Boolean = True
):
'''
stuff
'''
print(ch1)
print(ch2)
return datetime.now()
pr2 = Process(
my_proc2,
name='Custom name!'
)
a = App(
processes=[pr, pr2],
primary_colour='navy',
secondary_colour='darkgray',
accent_colour='lime',
background_colour='black'
)
a.build()
HTML:
Example use case 2 (creating custom jinja template)
Python:
from gui_gen import App, Process, arguments
from datetime import datetime
class CustomRegex(arguments.Regex):
pattern = r'[\d]*'
template_html = 'CustomRegex.jinja2' # path must be in the same location as class definition:
# folder/
# my_code_with_class.py # <- template_html = 'template.jinja2'
# template.jinja2
# or
# folder/
# my_code_with_class.py # <- template_html = 'stuff/template.jinja2'
# stuff/
# template.jinja2
def my_proc2(
text: CustomRegex,
ch1: arguments.Choice = [1,2,3,4],
):
'''
stuff
'''
return datetime.now()
pr2 = Process(
my_proc2,
name='Custom name!'
)
a = App(
processes=[pr2],
primary_colour='navy',
secondary_colour='darkgray',
accent_colour='lime',
background_colour='black'
)
a.build()
Jinja template:
{% extends "templates/generic.jinja2" %}
{% block input %}
<input
name={{argument.name}}
type="text"
placeholder="THIS IS CUSTOMIZATION FOR {{argument.__class__.__name__}}"
>
{% endblock %}
HTML:
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
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 GuiGen-1.0.1.tar.gz.
File metadata
- Download URL: GuiGen-1.0.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a343e450f2522a7583c825b9ff51cb341d67c2757eb6dca8ce4f3b595f9bcb9
|
|
| MD5 |
34e43d0d8befb9d725a927ce48523ab5
|
|
| BLAKE2b-256 |
b5d74e806e94d7067f47a147a53e48222718370081cfb333b9b5e8619dfebf38
|
Provenance
The following attestation bundles were made for GuiGen-1.0.1.tar.gz:
Publisher:
publish.yml on FilipM13/GuiGen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
guigen-1.0.1.tar.gz -
Subject digest:
6a343e450f2522a7583c825b9ff51cb341d67c2757eb6dca8ce4f3b595f9bcb9 - Sigstore transparency entry: 189010905
- Sigstore integration time:
-
Permalink:
FilipM13/GuiGen@2411c2d65f2480db2b7e1b5a3b33856f307ba2e3 -
Branch / Tag:
refs/tags/GuiGen_V1.0.1 - Owner: https://github.com/FilipM13
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2411c2d65f2480db2b7e1b5a3b33856f307ba2e3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file GuiGen-1.0.1-py3-none-any.whl.
File metadata
- Download URL: GuiGen-1.0.1-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5722ce7579b3bb42a684902a911de106e93da826e0c5a90fec9c23c5a5821ef8
|
|
| MD5 |
bd214f92ca1b7d97eda67ddd6c406eef
|
|
| BLAKE2b-256 |
43335c5f147b85ae204864efa0c6bebbb0b62f3ca980dc4d71db4f2df3be0b11
|
Provenance
The following attestation bundles were made for GuiGen-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on FilipM13/GuiGen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
guigen-1.0.1-py3-none-any.whl -
Subject digest:
5722ce7579b3bb42a684902a911de106e93da826e0c5a90fec9c23c5a5821ef8 - Sigstore transparency entry: 189010909
- Sigstore integration time:
-
Permalink:
FilipM13/GuiGen@2411c2d65f2480db2b7e1b5a3b33856f307ba2e3 -
Branch / Tag:
refs/tags/GuiGen_V1.0.1 - Owner: https://github.com/FilipM13
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2411c2d65f2480db2b7e1b5a3b33856f307ba2e3 -
Trigger Event:
release
-
Statement type: