Skip to content
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 generated HTML from the function show_html() in the ReportDataFrame class #168

Open
DiptenduIDEAS opened this issue Jan 23, 2024 · 1 comment
Labels

Comments

@DiptenduIDEAS
Copy link

The function show_html() is generating HTML and writing it to a file. It does not return any data. It would be useful if it return the generated HTML as a string so that it may be easily integrated with other libraries, for example Streamlit

report = sv.analyze(data)
svhtml = report.show_html(...)
streamlit.components.v1.html(svhtml)
@fbdesignpro
Copy link
Owner

@DiptenduIDEAS thank you for the report! Apologies for the long delay in answering, things have been crazy busy over here.

Good news: after the generation, the report is available through the report's _page_html variable. It's not pretty, but it works. I'll make a note of making it returned outright for better accessibility. In the meantime, the following should work:

report = sv.analyze(data)

report.show_html(...)
svhtml = report._page_html

streamlit.components.v1.html(svhtml)

Let me know that works, and if you run into any issues! Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants