-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return browsable gt object in Python repl #100
Comments
Thanks for looking into this issue! I've been looking around for python libraries that do something similar, and it seems like plotly might be a good example of this: import plotly.express as px
fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
# opens a browser window
fig.show() Since the gt for R opens a browser aimed at a temporary .html file, we should be able to do the same. WDYT of that approach? In python, I wonder if we should add a method, like I think the |
Maybe, I could be wrong, but in R, {gt} seems to rely on {htmltools} and I created a feature request posit-dev/py-htmltools#79 to ask if {py-htmltools} could possibly support |
@machow -- I have just learned from @cpsievert that we could use |
Great Tables uses htmltools, so this is perfect! I was able to get it to appear in the browser using this code in the IPython console... from great_tables import GT, exibble
from htmltools import HTML, TagList
res = GT(exibble).render("html")
el = HTML(res)
TagList(el).show("browser") Note that I had to pass "browser" as an argument. The default argument of "auto" didn't seem to do anything. It seems like at the very least we should add a |
That seems like a bug. If you can pinpoint the reason why it doesn't do anything, a issue/PR in htmltools would be much appreciated! |
Thanks for this great package! I am suggesting one feature request below.
In R {gt} package,
gt()
object returns browsable table in user's default browser. This is very convenient way for screen reader users to navigate data table in an alternative way. Could you please consider this in Python package as well?Currently,
GT()
method returns html code in Python repl. Browsable GT object might be more useful in an interactive terminal from end-user's perspective.The text was updated successfully, but these errors were encountered: