iPython notebooks with reactive UI - powered by RxPy and ipywidgets
Project description
General
This package adds functionality useful for making ReactiveX powered ipywidgets.
Note that this package is in its Beta stage and may change interfaces slightly before a 1.0 release.
Installation
Run poetry add rxwidgets
Usage
import rxwidgets.ipython as rxi
@rxi.interact_manual
def b(a=(1,5)):
return a * 5
@rxi.interact
def c(b=b, c=(10, 20)):
c = b + c
print(f"C: {c}")
Corresponds roughly to native ipywidgets:
from ipywidgets import interact, interact_manual
@interact_manual
def b(a=(1,5)):
b = a * 5
@interact
def c(c=(10, 20)):
c = b + c
print(f"C: {c}")
An incomprehensive feature list is provided in the examples folder.
Streams
A function stream consists of these steps:
@rxi.stream_defaults- Convert parameter defaults into observables - may display ipywidgets.
- Convert function into a stream of its results from input streams.
- In stream: Curry the function and make wrap into a
ValueBox. - Object in stream:
ValueBox(partial(fn, ...))
@rxi.defer,@rxi.pre_load, ...- If desired, apply operators to the call-ready function
@rxi.apply- Create and display an
rxi.Screen. - In stream: Run the function inside the screen and return results as a
ValueBox. - Object in stream:
ValueBox(fn(...))
- Create and display an
@rxi.Automap- If desired, pack the final stream into an
Automapobject. This object maps all operators to operators applied inside the stream.
- If desired, pack the final stream into an
Project details
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 rxwidgets-0.1.10.tar.gz.
File metadata
- Download URL: rxwidgets-0.1.10.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.8.10 Darwin/22.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0911aa2bdcf39481850907fbf51d4b008520cdd789d2aafa4da130cdef5f90fe
|
|
| MD5 |
18968fa288ffb13e4fe63f9e4e4f9f21
|
|
| BLAKE2b-256 |
5074f3b9dd7bc4ba2c1994551427ed67adb892fd4189c70bf2a69939703e6abc
|
File details
Details for the file rxwidgets-0.1.10-py3-none-any.whl.
File metadata
- Download URL: rxwidgets-0.1.10-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.8 CPython/3.8.10 Darwin/22.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78e802c49dda8a478e131829efac73fe4101152adcf18c7543a35b75c121450e
|
|
| MD5 |
3de0a2dd632f9b3e5128e2d1c3262550
|
|
| BLAKE2b-256 |
6b6e907e46f34ee6f2b5f811fe0693f2bc67f0794a36d5167c146b2a340f4664
|