Metadata-Version: 2.3
Name: python-manatools
Version: 0.99.4
Summary: Framework to build ManaTools applications
License: LGPL-2.1-or-later
Author: Angelo Naselli
Author-email: anaselli@linux.it
Maintainer: Angelo Naselli
Maintainer-email: anaselli@linux.it
Requires-Python: >=3.9
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: System :: Operating System
Provides-Extra: gtk
Provides-Extra: qt
Requires-Dist: PyCairo ; extra == "gtk"
Requires-Dist: PyGObject (>=3.42) ; extra == "gtk"
Requires-Dist: PySide6 (>=6.5) ; extra == "qt"
Requires-Dist: PyYAML
Requires-Dist: dbus-python
Requires-Dist: python-gettext
Project-URL: Bug Tracker, https://github.com/manatools/python-manatools/issues
Project-URL: Homepage, https://github.com/manatools/python-manatools
Project-URL: Repository, https://github.com/manatools/python-manatools
Description-Content-Type: text/markdown

# python-manatools #

![logo](https://avatars3.githubusercontent.com/u/19332721?v=3&s=200 "Python ManaTools")

Python ManaTools builds on the original Perl-based ManaTools idea, keeping the same goal of a shared toolkit and consistent UX while moving to Python to match systemd and D-Bus APIs. We are grateful to libyui for the foundation it provided, but this project now ships its own AUI layer and keeps evolving independently. Today it focuses on a backend-agnostic UI abstraction for GTK, Qt, ncurses, and the web, plus the services and helpers needed by ManaTools.

One application source tree runs unchanged on any of the four backends: a single `MUI_BACKEND` environment variable picks Qt, GTK 4, ncurses, or a browser UI served by a pure standard-library HTTP/WebSocket server — no extra dependency needed for the web backend.

See the AUI API documentation for details: [manatools AUI API](docs/manatools_aui_api.md).

## REQUIREMENTS

### Python >= 3.9
### Poetry >= 1.2.0

### Core dependencies (always required)
* **dbus-python** — D-Bus bindings used by `manatools.services`
* **PyYAML** — YAML configuration file support (`manatools.config`)
* **python-gettext** — internationalisation helpers

### UI backends (at least one required)

#### GTK 4 backend
* **PyGObject >= 3.42** (`gi`) — Python GObject introspection bindings
* **GTK 4** — the GTK 4 toolkit libraries (`gtk4`)
* **GdkPixbuf 2** — image loading for icons (`gdk-pixbuf2`)
* **pycairo** — Cairo drawing context used by GTK widgets (`python3-cairo`)
* *Optional:* **WebKitGTK 6.0** introspection data (gi namespace `WebKit` 6.0) — HTML engine for `YHtmlView`; without it the widget falls back to a text rendering in a `Gtk.Label` (Mageia: `lib64webkitgtk-gir6.0`). The WebKit2 4.x bindings target GTK 3 and are not used.

#### Qt backend
* **PySide6 >= 6.5.0** — Qt 6 Python bindings
* *Optional:* **QtWebEngine** bindings (`PySide6.QtWebEngineWidgets`) — HTML engine for `YHtmlView`; without them the widget falls back to `QTextBrowser`. The PyPI `PySide6` package already includes them; distributions often ship them separately (Mageia: `python3-pyside6-webenginewidgets`, which also needs `python3-pyside6-network`, `python3-pyside6-webchannel` and `python3-pyside6-printsupport`).

#### ncurses backend
* **curses** — included in the Python standard library (no extra install needed)
* `YHtmlView` renders HTML as navigable text; no extra dependency.

#### web backend
* No extra dependency — pure Python standard library (`http.server` + a hand-rolled WebSocket server). Runs in any modern browser; the server binds `127.0.0.1` only.
* `YHtmlView` is served into a sandboxed `<iframe>` by the same server; no extra dependency.

## SELECTING A BACKEND

Set `MUI_BACKEND` before the first call to `YUI.ui()`:

```
MUI_BACKEND=web python3 your_app.py
```

Accepted values: `qt`, `gtk`, `ncurses`, `web` (case-insensitive). Without it, Qt, GTK, and ncurses are auto-detected in that order — `web` is never auto-detected and must be requested explicitly.

## INSTALLATION

```
pip install python-manatools
```

Or from sources:

```
poetry install
```


