Assuming your raw HTML is assigned to raw_html
:
import base64
import streamlit as st
import streamlit.components.v1 as components
from pivottablejs import pivot_ui
mdf = pd.DataFrame({
"A": ["foo", "bar", "baz"],
"G": ["ADDA01", "ADDAA2", "AFFAA2"],
"E": [2, 4, 5]
})
t = pivot_ui(mdf)
with open(t.src) as t:
raw_html = t.read()
b4_raw_html = base64.b64encode(raw_html).decode()
src = f"data:text/html;base64,{b64_raw_html}"
components.iframe(src=src, width=900, height=1000, scrolling=True)
This code of mine my help too: This is how to use Sweetviz with Streamlit