PYUI: Python Threadsafe UI framework, with compiled xml layouts and python.With dynamic component reusebility and management.Supports css and JS. Comes with Tailwind compatibility.
Project description
PYUI(Python UI)
This project is targeted to make cross platform applications using python.PYUI is a layout pre-compiled framework for making python applications in very lightweight sizes. It uses a xml layouting system for defining layouts, python for logic and PYWebview as the renderer.Leading to a blank application size only 16MB compared to heavyweight rendering systems cosing 50+ MB or TKinter that has very legacy thread-unsafe architecture
Motivation
1.Making General Purpose Applications: This project is driven by the motivation of making a framework over python that can be used to make general purpose applications with little or no learning curve.
2.Smaller learning curve: Recent solutions for UI development mostly are hard to learn and manage. However we adopted age-old xml layouting system that makes defining UI easy for anyone with little xml/html knowlege.
3.Support of Python libaries and modules: On the logic side python can use used to it's Limit, also the threadsafe nature of the framework helps in extreme scalability.
4.Compiled Layout and Reusibility: This framework has pre-compiled layouting system.So errors in layout are identified on runtime. Also Layout supports re-usibility using PYUI Components.
Key Features of PYUI API
-
DOM Manipulation: One can change dom components from python side.There style,class,innertext and other attributes.
-
PYUI Custom Syscalls: Using this one can extend PYUI to support any JS libaries(chart.js and etc) by writing minimal Javascript.Or can use to commiunicate between JS ans Python runtime if needed without touching internal sockets.
-
PYUI Hooks: If some DOM updates are fast and can be lossy but realtime one can use PYUI Hooks.This can be mostly used to stream video or audio from Python to JS runtime
-
Window Management: A PYUI forms contain can contain more than one view(window) and PYUI provides apis to change windows dynamically. Also Exposes Webview object for PYwebview for changing the application window
-
Forms Management: PYUI provides dedicated apis to show and hide forms.
Getting Started
Setting up project
python -m PYUI.create <directory-of-project>
This will generate boilerplate project. Following folder and files will be generated in the given directory.
layout
code
layout/JS
layout/styles
code/index.py
code/__init__.py
layout/index.xml
settings.py
Compiling project
To compile to a PYUI project and run it
python -m PYUI.manage --compile <directory-of-project> --run
This command will compile your project into a PYUI project and run it. Within few seconds(depending on project size) you can see you layout
To compile without running project
python -m PYUI.manage --compile <directory-of-project>
It will save your project in build/temp_xxxxx.yyyy (see last line of buildscript output). To launch the project go to the directory and run:
python bootstrap.py
It will launch your UI
HotReloading Layouts
You can hot-reload the layout for faster UI development.
python -m PYUI.manage --hotreload <layout-xml-file>
Changing the xml file will reload the UI automatically
Note: Use the --keepontop flag to keep the UI on top always
For further API references for XML and PYUI check the PYUI Documentation
Credits
PyWebview: https://github.com/r0x0r/pywebview
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 pyui_desktop-0.6.tar.gz.
File metadata
- Download URL: pyui_desktop-0.6.tar.gz
- Upload date:
- Size: 72.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
499cac6ef43c5e931af43930b53de1593f1b40751a1c875a54c0fdcbb7e77860
|
|
| MD5 |
f5d190a83aa009c634e1acf92f1ec81e
|
|
| BLAKE2b-256 |
fd2f5b99d80eedb52be46fedf3f589629c7631fe74468d09c08ffb833352609b
|
File details
Details for the file pyui_desktop-0.6-py3-none-any.whl.
File metadata
- Download URL: pyui_desktop-0.6-py3-none-any.whl
- Upload date:
- Size: 73.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d17430a779e9b9c01f21cda3db0ef817c883e25044bd167ddc101dac70bc588
|
|
| MD5 |
8baeecde654a2ae098787f21f326297d
|
|
| BLAKE2b-256 |
eb2eefd7a6fc4b694688c8d94c9fc144de08acaead3a08b4599dc2758ffd5d4c
|