posit-dev / posit-dev/py-shiny

Are there plans to support outputs displayed with IPython.display?

Open
#303 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.8k
Forks
135
Avg merge
2d 18h
Merged PRs (30d)
21

Description

Thanks for porting Shiny to Python - Years ago I was a user of Shiny for R and it was a really great package!

I happen to maintain a port of another great R package to Python (DT, my port is the itables project) and I was asked if that port could work under py-shiny (https://github.com/mwouts/itables/issues/86).

I think I could be able to implement some decorator like render.itables, but before undertaking that I'd like to ask if you plan to support outputs displayed with the IPython.display module.

It is standard practice in (Python) Jupyter notebooks to display Markdown/HTML and also Javascript components by just calling display. Of course if you display a single output in a cell you don't need to explicitly call display, but if you want to display both a Markdown header and a a dataframe you can use e.g.

import pandas as pd
from IPython.display import display, Markdown

display(Markdown("# Title"))
display(pd.DataFrame({'a':[5,6]}))

which shows the H1 title followed by the HTML table.

I think it would be a competitive advantage for Shiny for Python if these Jupyter outputs were directly supported in Shiny, because then Jupyter users would not have much to learn before they can use Shiny. AFAIK the IPython outputs are not supported in Dash by Plotly (another great package by the way), and the only dashboard system for Python that does support IPython outputs is Voila.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue focuses on IPython.display outputs in Shiny for Python and mentions integration with itables. Start by reviewing Shiny's existing output and rendering entry points, then compare their behavior with IPython.display for Markdown, HTML, JavaScript, and dataframes. Done would mean these displayed outputs work in Shiny, including the itables use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.