Metadata-Version: 2.4
Name: pyui-toolkit
Version: 0.1.0
Summary: A lightweight, pure-Python UI toolkit with pluggable rendering backends
License: MIT
Keywords: ui,widgets,gui,pure-python,pyphone
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# pyUI

**pyUI is a small Python toolkit for building simple user interfaces with labels, buttons, text-entry fields, and images.** It provides one simple API with different rendering options depending on the Python environment.

## Quick example

```python
import pyui

pyui.label("Hello!")
name = pyui.entry("Your name")
pyui.button("Say hello", lambda: print("Hello", name.get()))
pyui.show("My first pyUI app")
```

This example creates a label, a text-entry field, and a button. Pressing the button prints the entered name.

## What is included?

- **Labels** for displaying text
- **Buttons** for running a callback when pressed
- **Entry fields** with simple `get()` and `set()` methods
- **Images** for displaying supported image objects or PNG file paths
- **Widget clearing** for removing existing widgets
- A `show()` function to display the interface

The toolkit is designed to make simple interfaces easier to write. It is not a drop-in replacement for Tkinter, Kivy, or every other UI framework, and it does not currently offer every feature those frameworks provide.

## Where does it run?

pyUI uses a renderer appropriate to the environment:

- **Desktop Python:** uses Tkinter when it is available.
- **PyPhone:** can use PyPhone's native `ui` module when that module is already loaded.
- **Other Python environments:** require a compatible backend. Browser-hosted Python environments expose different APIs, so desktop windows are not guaranteed to work everywhere.

pyUI does not require PyPhone. The PyPhone renderer is an optional integration, not a requirement for the whole toolkit.

## Images and HeliOS

HeliOS is optional. If you have both libraries, you can pass a HeliOS image to pyUI:

```python
import pyui
import helios

art = helios.new("RGB", (100, 100), (255, 0, 0))
pyui.image(art)
pyui.show("Image preview")
```

A PNG file path can also be passed to `pyui.image()`.

## Contributing

Bug reports, reproducible examples, and suggestions are welcome. When reporting a problem, include your Python version, the environment or backend you're using, and the full error message when possible.
