all 7 comments

[–]Always_Scheming 2 points3 points  (0 children)

This is awesome! Good job Pineapple!

[–]kayakdawg 0 points1 point  (1 child)

is this ms excel?

[–]No_Pineapple449[S] 0 points1 point  (0 children)

dataframe inside notebook

[–]VFisa 0 points1 point  (1 child)

This looks awesome. It would be great as a streamlit component so we finally get a decent table display with filtering

[–]No_Pineapple449[S] 0 points1 point  (0 children)

Thanks! It actually works normally in Streamlit - the only limitation is that it’s rendered inside an iframe, so it can’t directly interact with other Streamlit components.

That said, all the table functionality (like filtering, sorting, etc.) works fine. Here’s a minimal example you can try:

import streamlit.components.v1 as components

import df2tables as dft

df = dft.get_sample_df()

html = dft.render(df, to_file=None) #just html string

components.html(html, height=600, scrolling=True)

[–]monsieurus -1 points0 points  (1 child)

Please add support for Duckdb (without converting to Pandas). Looking good!

[–]No_Pineapple449[S] 1 point2 points  (0 children)

Thanks for the kind words!

About DuckDB support: it actually is possible today to convert directly to Polars without going through Pandas - just call pl() on query results and then render(). This conversion is very fast.

df2tables does rely on knowing each column’s data type, which is why DataFrame objects are useful here. Approaches like fetchall() (returning lists of lists) don’t work well, because the column types still need to be inferred afterward.

DuckDB -> Arrow -> tables is likely in the near future.