Streamlitの標準st.dataframeを拡張した高機能カスタムコンポーネント
Project description
streamlit-advanced-dataframe
Streamlit's st.dataframe with advanced features using TanStack Table.
Installation
pip install streamlit-advanced-dataframe
Usage
import pandas as pd
from streamlit_advanced_dataframe import advanced_dataframe
df = pd.DataFrame({
"name": ["Alice", "Bob", "Charlie"],
"age": [25, 30, 35],
"city": ["Tokyo", "Osaka", "Kyoto"]
})
# Basic usage
advanced_dataframe(data=df, height=400, key="my_table")
# Single row selection
selected = advanced_dataframe(
data=df,
selection_mode="single-row",
key="selectable_table"
)
if selected:
st.write(f"Selected rows: {selected}") # Returns list[int]
# Multi-row selection
selected = advanced_dataframe(
data=df,
selection_mode="multi-row",
key="multi_selectable_table"
)
if selected:
st.dataframe(df.iloc[selected]) # Show selected rows
# Filter columns
advanced_dataframe(
data=df,
filterable_columns=["name", "age", "city"],
show_row_count=True,
key="filterable_table"
)
# Header groups
advanced_dataframe(
data=df,
header_groups=[
{"header": "Personal Info", "columns": ["name", "age"]},
{"header": "Location", "columns": ["city"]}
],
key="grouped_table"
)
# Column config (prefix/suffix)
df_sales = pd.DataFrame({
"product": ["Product A", "Product B"],
"price": [1000, 2000],
"discount": [10, 20]
})
advanced_dataframe(
data=df_sales,
column_config={
"price": {"prefix": "$"},
"discount": {"suffix": "%"}
},
key="config_table"
)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
data |
pd.DataFrame |
required | DataFrame to display |
height |
int |
600 |
Table height in pixels |
use_container_width |
bool |
False |
Use full container width |
selection_mode |
"single-row" | "multi-row" | None |
None |
Row selection mode |
filterable_columns |
list[str] | None |
None |
Columns to enable filtering |
show_row_count |
bool |
False |
Show filtered row count |
column_order |
list[str] | None |
None |
Columns to display (in order) |
header_groups |
list[dict] | None |
None |
Header group configuration |
expandable |
bool |
False |
Enable row expansion |
sub_rows_key |
str |
"subRows" |
Key for sub-row data |
show_summary |
bool |
True |
Show summary row |
column_config |
dict[str, dict] | None |
None |
Per-column display config (prefix/suffix) |
key |
str | None |
None |
Streamlit component key |
Returns
list[int] - List of selected row indices (0-based). Returns an empty list [] when no rows are selected or selection_mode is None.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamlit_advanced_dataframe-0.1.0.tar.gz.
File metadata
- Download URL: streamlit_advanced_dataframe-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6941da152d3796be2a1db9ff83c20b8d8041780c96319e31f8bfc07734e259dc
|
|
| MD5 |
9d86b9184b366c935ae981953d88bac3
|
|
| BLAKE2b-256 |
b15e6d6d11ed2784e9ccf8efcbe51ce048340595598cb532bd62702dee6d0894
|
Provenance
The following attestation bundles were made for streamlit_advanced_dataframe-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on j4rviscmd/streamlit-advanced-dataframe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
streamlit_advanced_dataframe-0.1.0.tar.gz -
Subject digest:
6941da152d3796be2a1db9ff83c20b8d8041780c96319e31f8bfc07734e259dc - Sigstore transparency entry: 789550290
- Sigstore integration time:
-
Permalink:
j4rviscmd/streamlit-advanced-dataframe@75a6b58de0ff788eb6d132f91eda4e627bcc2104 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/j4rviscmd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@75a6b58de0ff788eb6d132f91eda4e627bcc2104 -
Trigger Event:
push
-
Statement type:
File details
Details for the file streamlit_advanced_dataframe-0.1.0-py3-none-any.whl.
File metadata
- Download URL: streamlit_advanced_dataframe-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
165bcc6e272ca8a154a55675ada297b0681e03f9185d2738bcfdf10b661cf04e
|
|
| MD5 |
6406d8856906f3a746ecbac32ffb1bd4
|
|
| BLAKE2b-256 |
ee2b22b07840177249b854f5b9f00c1d376945850084acb0881a433a61d6b0e2
|
Provenance
The following attestation bundles were made for streamlit_advanced_dataframe-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on j4rviscmd/streamlit-advanced-dataframe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
streamlit_advanced_dataframe-0.1.0-py3-none-any.whl -
Subject digest:
165bcc6e272ca8a154a55675ada297b0681e03f9185d2738bcfdf10b661cf04e - Sigstore transparency entry: 789550297
- Sigstore integration time:
-
Permalink:
j4rviscmd/streamlit-advanced-dataframe@75a6b58de0ff788eb6d132f91eda4e627bcc2104 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/j4rviscmd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@75a6b58de0ff788eb6d132f91eda4e627bcc2104 -
Trigger Event:
push
-
Statement type: