Package: guiml
guimlA 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 stateThe 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.DokumentationThe dokumentation and a small tutorial can be found atguiml.readthedocs.io.InstallationStep 1) Install non Python DependenciesDebian/ Ubuntu / Windows with WSL2 + DebianInstall external requirenments (to access librsvg, cairo, pango from python)sudo apt install librsvg2-dev libcairo2-dev python3-gi-cairo
cd guiml
pip install -r requirements.txtIf 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 needpygobjectwith cairo and librsvg.Check how to installcairocffiandpangocffion
their respective sites.Once the dependencies are installed you should be able to run the examples
after installing the python dependenciespip install -r requirements.txt
python3 -m examples.todolistIf you want to use guiml for your own project you can install it directly viapip install .Step 2a) Installation from sourceIt is recommended to use the latest version of pip and setuptools.pip install -U pip setuptoolsYou can install the project from source viagit 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 runpython3 -m examples.todolistTo update to the latest version, rungit pullStep 2b) Installation from PyPitbd.MiscLicenseYou can usefind . -name LICENSEto 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 WorkYou can find more boradly used GUI frameworks onawesome-python.See also:collgraphWrite 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!