rxwidgets


Namerxwidgets JSON
Version 0.1.10 PyPI version JSON
download
home_pagehttps://github.com/Ivorforce/rxwidgets
SummaryiPython notebooks with reactive UI - powered by RxPy and ipywidgets
upload_time2022-12-05 12:57:39
maintainer
docs_urlNone
authorLukas Tenbrink
requires_python>=3.8,<3.11
licenseMIT
keywords ipython reactivex
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # General

This package adds functionality useful for making [ReactiveX](https://rxpy.readthedocs.io) powered [ipywidgets](https://ipywidgets.readthedocs.io/en/latest/).

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

```py
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:

```py
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:

1. `@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, ...))`
2. `@rxi.defer`, `@rxi.pre_load`, ...
   - If desired, apply operators to the call-ready function
3. `@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(...))`
4. `@rxi.Automap`
    - If desired, pack the final stream into an `Automap` object. This object maps all operators to operators applied inside the stream.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Ivorforce/rxwidgets",
    "name": "rxwidgets",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<3.11",
    "maintainer_email": "",
    "keywords": "ipython,reactivex",
    "author": "Lukas Tenbrink",
    "author_email": "lukas.tenbrink@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/50/74/f3b9dd7bc4ba2c1994551427ed67adb892fd4189c70bf2a69939703e6abc/rxwidgets-0.1.10.tar.gz",
    "platform": null,
    "description": "# General\n\nThis package adds functionality useful for making [ReactiveX](https://rxpy.readthedocs.io) powered [ipywidgets](https://ipywidgets.readthedocs.io/en/latest/).\n\nNote that this package is in its Beta stage and may change interfaces slightly before a 1.0 release.\n\n# Installation\n\nRun `poetry add rxwidgets`\n\n# Usage\n\n```py\nimport rxwidgets.ipython as rxi\n\n@rxi.interact_manual\ndef b(a=(1,5)):\n    return a * 5\n\n@rxi.interact\ndef c(b=b, c=(10, 20)):\n    c = b + c\n    print(f\"C: {c}\")\n```\n\nCorresponds roughly to native ipywidgets:\n\n```py\nfrom ipywidgets import interact, interact_manual\n\n@interact_manual\ndef b(a=(1,5)):\n    b = a * 5\n\n    @interact\n    def c(c=(10, 20)):\n        c = b + c\n        print(f\"C: {c}\")\n```\n\nAn incomprehensive feature list is provided in the `examples` folder.\n\n# Streams\n\nA function stream consists of these steps:\n\n1. `@rxi.stream_defaults`\n   - Convert parameter defaults into observables - may display ipywidgets.\n   - Convert function into a stream of its results from input streams.\n   - In stream: Curry the function and make wrap into a `ValueBox`.\n   - Object in stream: `ValueBox(partial(fn, ...))`\n2. `@rxi.defer`, `@rxi.pre_load`, ...\n   - If desired, apply operators to the call-ready function\n3. `@rxi.apply`\n    - Create and display an `rxi.Screen`.\n    - In stream: Run the function inside the screen and return results as a `ValueBox`.\n    - Object in stream: `ValueBox(fn(...))`\n4. `@rxi.Automap`\n    - If desired, pack the final stream into an `Automap` object. This object maps all operators to operators applied inside the stream.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "iPython notebooks with reactive UI - powered by RxPy and ipywidgets",
    "version": "0.1.10",
    "split_keywords": [
        "ipython",
        "reactivex"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "3de0a2dd632f9b3e5128e2d1c3262550",
                "sha256": "78e802c49dda8a478e131829efac73fe4101152adcf18c7543a35b75c121450e"
            },
            "downloads": -1,
            "filename": "rxwidgets-0.1.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3de0a2dd632f9b3e5128e2d1c3262550",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<3.11",
            "size": 20723,
            "upload_time": "2022-12-05T12:57:37",
            "upload_time_iso_8601": "2022-12-05T12:57:37.669678Z",
            "url": "https://files.pythonhosted.org/packages/6b/6e/907e46f34ee6f2b5f811fe0693f2bc67f0794a36d5167c146b2a340f4664/rxwidgets-0.1.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "18968fa288ffb13e4fe63f9e4e4f9f21",
                "sha256": "0911aa2bdcf39481850907fbf51d4b008520cdd789d2aafa4da130cdef5f90fe"
            },
            "downloads": -1,
            "filename": "rxwidgets-0.1.10.tar.gz",
            "has_sig": false,
            "md5_digest": "18968fa288ffb13e4fe63f9e4e4f9f21",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<3.11",
            "size": 14421,
            "upload_time": "2022-12-05T12:57:39",
            "upload_time_iso_8601": "2022-12-05T12:57:39.885639Z",
            "url": "https://files.pythonhosted.org/packages/50/74/f3b9dd7bc4ba2c1994551427ed67adb892fd4189c70bf2a69939703e6abc/rxwidgets-0.1.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-05 12:57:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Ivorforce",
    "github_project": "rxwidgets",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "rxwidgets"
}
        
Elapsed time: 0.01740s