Reactivity library for PyQT
Project description
pyqt-reactivity
Description
pyqt-reactivity is a project that aims to provide basic reactivity module for PyQt widgets.
Installation
Install the latest version from PyPI:
pip install -U pyqt-reactivity
Usage
To use basic reactivity module, see the following example:
from pyqt_reactivity import Ref, computed, ref
# Create a reactive reference.
a = ref(1)
a.watch(lambda v: print("a updated:", v))
# Define a computed function that depends on the reactive reference.
def a_squared(a: Ref[float]) -> float:
return a.value**2
# Create a computed reference.
b = computed(a_squared, args=(a,))
b.watch(lambda v: print("b updated:", v))
# Update the reactive reference.
a.value = 2
See more implementations on examples folder.
License
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
pyqt_reactivity-0.2.0.tar.gz
(6.0 kB
view details)
Built Distribution
File details
Details for the file pyqt_reactivity-0.2.0.tar.gz
.
File metadata
- Download URL: pyqt_reactivity-0.2.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8295052d0c15ae33f008ecfc517fd0cc3e9c23ca7c58426820f1b1f8c7489929 |
|
MD5 | 423ded013f23f217f02ab7cbbd246501 |
|
BLAKE2b-256 | ace7db1efaebcc1ddf3312ae1b269097a9bc50d09412db3a5385eb4eb4befa47 |
File details
Details for the file pyqt_reactivity-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pyqt_reactivity-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d2470a31f92ce5e8472e403ecde7b4c82bed00ac98c0485bd958939d17e2668 |
|
MD5 | ed57665820da84419339f4a58b4bfa09 |
|
BLAKE2b-256 | b8c4ccd8af575b00841f0487e69da60973bb2a811609ee93e868352d3337b7ee |