Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

rxwidgets

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rxwidgets

iPython notebooks with reactive UI - powered by RxPy and ipywidgets

pipPyPI
Version
0.1.10
Maintainers
1

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(...))
  • @rxi.Automap
    • If desired, pack the final stream into an Automap object. This object maps all operators to operators applied inside the stream.

Keywords

ipython

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts