# What’s the Best Way to Use Widgets for Real-Time Data in Jupyter?

**URL:** <https://discourse.jupyter.org/t/what-s-the-best-way-to-use-widgets-for-real-time-data-in-jupyter/37512>\
**Category:** Widgets\
**Created:** [August 12, 2025, 8:53am UTC](https://discourse.jupyter.org/t/what-s-the-best-way-to-use-widgets-for-real-time-data-in-jupyter/37512 "2025-08-12T08:53:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fopodon](https://avatars.discourse-cdn.com/v4/letter/f/a88e4f/32.png) [@fopodon](https://discourse.jupyter.org/u/fopodon)\
**Post date:** [August 12, 2025, 8:53am UTC](https://discourse.jupyter.org/t/what-s-the-best-way-to-use-widgets-for-real-time-data-in-jupyter/37512/1 "2025-08-12T08:53:20Z")

</div>

Hello

I have been building a Jupyter dashboard where data updates often sometimes every few seconds. I want to show these changes live using widgets like sliders / dropdowns; without having to manually re-run the notebook each time. 😇

I am looking for ideas on how to load live data into widgets while keeping everything smooth & responsive.😐

I know about basic `ipywidgets` features like the `@interact` decorator and some layout controls, but I am not sure how to refresh widget outputs automatically. 🤔

Are there good methods maybe using async updates, callbacks / custom widget code that let you push new data into widgets without manual steps?🤔 Checked [Tutorial: Understanding Jupyter Notebook Widgets | Saturn Cloud Blog](https://saturncloud.io/blog/understanding-jupyter-notebook-widgets/) guide related to this and found it quite informative.

Also; while researching this, I came across [what is Azure Databricks](https://www.igmguru.com/blog/what-is-azure-databricks), which has its own widget system and integrates `ipywidgets` for interactive notebooks. That made me wonder if some of those ideas could work in a regular Jupyter environment too.😇 I would love to hear from anyone who has built live data dashboards in Jupyter & how they made them run smoothly.

Thank you !!🙂

---

<div class="post-metadata">

**Author:** ![bollwyvl](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/bollwyvl/32/904_2.png) [@bollwyvl](https://discourse.jupyter.org/u/bollwyvl)\
**Post date:** [August 12, 2025, 2:27pm UTC](https://discourse.jupyter.org/t/what-s-the-best-way-to-use-widgets-for-real-time-data-in-jupyter/37512/2 "2025-08-12T14:27:06Z")

</div>

It kind of depends on how much live data we are talking about.

If the underlying data model already has an evented API, just setting a widget will be enough to do whatever should happen in the graph of widgets.

If the API isn’t evented, and it’s okay to send all the data every time on a schedule:

```python
import asyncio
import ipywidgets as W
import time

interval = W.FloatSlider(1, min=0, max=10, description="interval")
current = W.FloatText()
display(W.HBox([interval, current]))

def tick():
    current.value = time.time()

async def tick_loop():
    while True:
        await asyncio.sleep(interval.value)
        try:
            tick()
        except:
            pass

task = asyncio.get_event_loop().create_task(tick_loop())

```

In the above, this would still be pretty interactive, as changing the definition of `tick` would run the new code every `interval.value`.

The [custom event](https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20Events.html#special-events) pattern (which powers `Button.click`) is an example of opting out of the “send the whole thing” pattern. Usually making full use of this would require some custom python and javascript to send only the _right_ changed data, and update any in-browser values correctly.
