guiml
A simple to use GUI framework for python. You define what you want and the framework does the rest. You build the UI out of components that are defined using XML as markup language. The markup language allows you to interact with your python code via variable binding, callbacks and the use of control flow primitives. To help you with organizing your application, the framework allows you to nicely compose components and comes with automated dependency injection. (You know vue.js or angular from web development? Something like that.)
Ever wondered why so many GUIs nowadays seem to be written with a HTTP/CSS/JS front end, even for desktop (e.g. via electron)? How is that the easiest way of designing modern GUIs? Some things in web front end development are nice and shiny, like live inspection and editing of styles, reactive variable bindings, defining components and the UI in a nice markup language, allow control flow in the markup language, have automatic dependency injection...
Can't we have all these nice things but in python? And without the hassle of a client-server architecture and java script?
This project is a case study where I try to figure out and build the GUI framework that I would want to use. To not have to deal with legacy issues of other GUI frameworks, this project starts quite low level using pyglet as window engine and to deal with IO, cairo for drawing and pango for text setting and librsvg for svg drawing. Everything else is build from scratch.
Current state
The current state is a proof of concept. It should work on the examples, but is other wise terribly tested, barely documented and probably throws non-sensical error messages at you when you do something wrong. The API is unstable.
Dokumentation
The dokumentation and a small tutorial can be found at guiml.readthedocs.io.
Installation
Step 1) Install non Python Dependencies
Debian/ Ubuntu / Windows with WSL2 + Debian
Install external requirenments (to access librsvg, cairo, pango from python)
sudo apt install libgirepository2.0-dev librsvg2-dev libcairo2-dev python3-gi-cairo
If you run into problems with installing the dependencies, you can check out the links in the Other section below.
Other (Windows Native / Mac / Other Linux Distributions)
For Windows it is recommended to use Debian on WSL2 (Instructions) once on the Debian command line you can follow the normal Debian instructions for installing this package.
If you are not on a debian derivate, then installation should in principle be possible if you are sufficiently brave and smart, but you will have to figure it out yourself. Here are some links to the dependencies that might be helpfull.
You will need pygobject with cairo and librsvg.
Check how to install cairocffi and pangocffi on their respective sites.
Step 2a) Installation from source
It is recommended to use the latest version of pip and setuptools.
pip install -U pip setuptools
You can install the project from source via
git clone https://github.com/StephanGocht/guiml.git
cd guiml
pip install -e .
After installation (or just installing the packages from requirements.txt) you can run the examples from the guiml folder to confirm everything is working. For the todo list example run
python3 -m examples.todolist
To update to the latest version, run
git pull
Step 2b) Installation from PyPi
pip install guiml
Misc
License
You can use find . -name LICENSE to collect all used licenses. The license
applies to all files in the contained directory or subdirectories.(Except for
directories that have their own LICENSE). Which should currently be as
follows.
./LICENSE (MIT)
./guimlcomponents/base/cairocffi_to_pycairo/LICENSE (BSD-3)
./examples/todolist/resources/material-design-icons/LICENSE (Apache-2)
Examples are not included in builds.
Related Work
You can find more boradly used GUI frameworks on awesome-python.
See also:
Write your Python interfaces in a declarative manner with plain render functions, component classes or even single-file components using Vue-like syntax, but with Python!
Metadata
Release files for guiml 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| guiml-0.2.0.tar.gz | 63.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| guiml-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 95.2 kB
Release files / guiml-0.2.0.tar.gz
| Download URL | guiml-0.2.0.tar.gz |
|---|---|
| Size | 63.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
adeea5050962737766f731817bc212347ad82f728ae635de35571d6183a8b732
|
|
BLAKE2b-256 checksum How to use checksums |
b8214a47d0232b00012fbdbd9bd4152098d6f601146456bb85220b9acf3ade2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.19
|
Release files / guiml-0.2.0-py3-none-any.whl
| Download URL | guiml-0.2.0-py3-none-any.whl |
|---|---|
| Size | 32.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d2ea534c653dadd3c67ef0b5b8f6f1d57dbfc450f1e50ca238f6173e17beade8
|
|
BLAKE2b-256 checksum How to use checksums |
e5b7343074a8171bc590fc0acac52dbb4d873c616a40973623163c26788a10cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.19
|
Security for guiml 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.