Dynamic multiselect filters for Streamlit
Project description
Custom component to create dynamic multiselect filters in Streamlit. The filters apply to a dataframe and adjust their values based on the user selection (similar to Google Sheets slicers or Only Relevant Values in Tableau).
Sample usage:
import streamlit as st
from streamlit_dynamic_filters import DynamicFilters
data = {
'Region': ['North America', 'North America', 'North America', 'Europe', 'Europe', 'Asia', 'Asia'],
'Country': ['USA', 'USA', 'Canada', 'Germany', 'France', 'Japan', 'China'],
'City': ['New York', 'Los Angeles', 'Toronto', 'Berlin', 'Paris', 'Tokyo', 'Beijing']
}
df = pd.DataFrame(data)
dynamic_filters = DynamicFilters(df, filters=['Region', 'Country', 'City'])
with st.sidebar:
dynamic_filters.display_filters()
dynamic_filters.display_df()
Demo GIF:
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
Close
Hashes for streamlit_dynamic_filters-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f49d941273a01ce399a639211c024c06fba751bb88a82f22fc1dac203ba37a2 |
|
MD5 | 711c996016abc138a0b3e2c4bfd1ee05 |
|
BLAKE2b-256 | 4b577b9207a4a893d1b82c5a9f2650c17dfc6da2388c1adaeb905432e9a5ee90 |
Close
Hashes for streamlit_dynamic_filters-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a2ca85a147a9ff4c896c3beee3a727ced35a5e819f9e7605d5e16fba3eff014 |
|
MD5 | d9a2c58c89f889e6b4f9a42f2cdf694e |
|
BLAKE2b-256 | 1f7ed626cf783c51fa136297652051bd04e53d94c98f898ab31870ec5056ec86 |