https://github.com/vdutor/fluid
Lightweight Reactive Python framework for Web
https://github.com/vdutor/fluid
Last synced: 8 months ago
JSON representation
Lightweight Reactive Python framework for Web
- Host: GitHub
- URL: https://github.com/vdutor/fluid
- Owner: vdutor
- License: apache-2.0
- Created: 2022-06-05T23:11:57.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-08T21:52:10.000Z (almost 4 years ago)
- Last Synced: 2024-03-03T02:40:29.400Z (over 2 years ago)
- Language: Python
- Homepage:
- Size: 474 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/vdutor/fluid/actions/workflows/quality-check.yaml)
# Fluid: A Reactive Framework For Python
```python
from fluid.signal import Signal, createEffect, createMemo
n1 = Signal(10)
n2 = Signal(5)
product = createMemo(lambda: n1() * n2())
@createEffect
def print_product():
print("product:", product())
@createEffect
def print_n1():
print("n1:\t", n1())
@createEffect
def print_n2():
print("n2:\t", n2())
n1.assign(-1)
```
Outputs:
```
> product: 50
> n1: 10
> n2: 5
> product: -5
> n1: -1
```
## Installation: only required for development
```
make install
```
### Install graphviz
Used for debugging and computation graph visualisation
* Ubuntu
```
sudo apt install graphviz
```
* Mac
```
brew install graphviz
```