Skip to main content

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

  1. DOM Manipulation: One can change dom components from python side.There style,class,innertext and other attributes.

  2. 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.

  3. 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

  4. 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

  5. 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

pyui_desktop-1.0.0.tar.gz (82.7 kB view details)

Uploaded Source

Built Distribution

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

pyui_desktop-1.0.0-py3-none-any.whl (83.5 kB view details)

Uploaded Python 3

File details

Details for the file pyui_desktop-1.0.0.tar.gz.

File metadata

  • Download URL: pyui_desktop-1.0.0.tar.gz
  • Upload date:
  • Size: 82.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for pyui_desktop-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e8f9d1d414ad80135433a8ea3e06bdab12d886ef846589882ae0ac5f4268c7d5
MD5 a2ae9ea3204e7f6e7b85f21dfca37a81
BLAKE2b-256 d5c60ede3221910e96db90bb46c2921a974c04181d0a03161ad29ef0abdebdab

See more details on using hashes here.

File details

Details for the file pyui_desktop-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyui_desktop-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 83.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for pyui_desktop-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd61e7e77820bb92912e699cccf0a53761275e4674678f3507ebcbf767d1442e
MD5 a2d6fedec984fe437d39dc69c729b406
BLAKE2b-256 576d4f7f74c9d441ed6ab02ae86ee19feb799f8e4998424a09b3e36d3bf30121

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