A signal-native, declarative GUI framework for Python
Project description
pymiro
Signal-native, declarative GUI framework for Python.
What is pymiro?
pymiro is a modern GUI framework for Python that brings web-like declarative syntax and fine-grained reactivity to the desktop. Inspired by SolidJS, it uses a signal-based reactivity engine and a keyed virtual DOM to efficiently update Qt widgets (PySide6) without relying on heavy class hierarchies or complex event bindings.
Why pymiro?
| Feature | tkinter | PyQt6 / PySide6 | pymiro |
|---|---|---|---|
| Declarative | ❌ | ❌ | ✅ |
| Reactive signals | ❌ | ❌ | ✅ |
| Component model | ❌ | ❌ | ✅ |
| Hot reload | ❌ | ❌ | ✅ |
| Theming | ❌ | manual | ✅ |
| Type safe | ❌ | partial | ✅ |
Installation
pip install pymiro
Requires Python 3.12+
Quick start
import sys
from PySide6.QtWidgets import QApplication
from pymiro.core import signal, component, effect
from pymiro.elements import Window, VBox, Text, Button
from pymiro.renderer import render
@component
def Counter():
count, set_count = signal(0)
return Window(title="pymiro Counter")(
VBox()(
Text(text=lambda: f"Count: {count()}"),
Button(text="Increment", on_click=lambda: set_count(count() + 1)),
Button(text="Decrement", on_click=lambda: set_count(count() - 1))
)
)
if __name__ == "__main__":
app = QApplication(sys.argv)
render(Counter(), None)
sys.exit(app.exec())
Core concepts
Signals
Signals are the primitives of reactivity in pymiro. They track state and automatically update any components or effects that depend on them.
from pymiro.core import signal, computed
count, set_count = signal(5)
double_count = computed(lambda: count() * 2)
print(double_count()) # 10
set_count(10)
print(double_count()) # 20
Components
Components in pymiro are simple functions decorated with @component that return virtual nodes representing the UI.
from pymiro.core import component
from pymiro.elements import VBox, Text
@component
def Greeting(name: str):
return VBox()(
Text(text=f"Hello, {name}!")
)
Theming
pymiro includes a built-in design token system and light/dark themes that can be applied to your application easily.
from pymiro.theme import ThemeProvider, DarkTheme
from pymiro.elements import Window
@component
def App():
return ThemeProvider(theme=DarkTheme())(
Window()(
# Your components here...
)
)
Project status
Alpha — API may change before 1.0.0. Check out our Roadmap.
Contributing
See CONTRIBUTING.md for details on how to set up the project and run tests.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymiro-0.1.1.tar.gz.
File metadata
- Download URL: pymiro-0.1.1.tar.gz
- Upload date:
- Size: 73.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe66d7554514da93cc8d49d53fc129a2b99b6b3ba4e797f2696a9f551ec1c3aa
|
|
| MD5 |
1390c0f06e9ed78d8de33c1d7bccd4c1
|
|
| BLAKE2b-256 |
3246d5d07fee02ce67591206ae285aefb3a248a5be1b002e24814db33d471338
|
Provenance
The following attestation bundles were made for pymiro-0.1.1.tar.gz:
Publisher:
publish.yml on LikhinMN/pymiro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymiro-0.1.1.tar.gz -
Subject digest:
fe66d7554514da93cc8d49d53fc129a2b99b6b3ba4e797f2696a9f551ec1c3aa - Sigstore transparency entry: 1779169712
- Sigstore integration time:
-
Permalink:
LikhinMN/pymiro@1f240e4db0126340c5475811927ec5095eee2515 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/LikhinMN
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1f240e4db0126340c5475811927ec5095eee2515 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pymiro-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pymiro-0.1.1-py3-none-any.whl
- Upload date:
- Size: 29.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3dd19bc72d0ecb0edcc053da95b3204b9604575fbb361789a08713a5db12337
|
|
| MD5 |
77e71961b0bd94ddd512fee42384bd41
|
|
| BLAKE2b-256 |
995f57da59f81022983087242f2b140e1ce9aa7051cf4d7b7357e469e77e7af0
|
Provenance
The following attestation bundles were made for pymiro-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on LikhinMN/pymiro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymiro-0.1.1-py3-none-any.whl -
Subject digest:
b3dd19bc72d0ecb0edcc053da95b3204b9604575fbb361789a08713a5db12337 - Sigstore transparency entry: 1779169949
- Sigstore integration time:
-
Permalink:
LikhinMN/pymiro@1f240e4db0126340c5475811927ec5095eee2515 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/LikhinMN
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1f240e4db0126340c5475811927ec5095eee2515 -
Trigger Event:
push
-
Statement type: