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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 775b7b2e2af25c167ca7831594371f085eedfcffd48676d97e905ef0862e1d3a |
|
MD5 | 04484ed1c90e7286faf9e6b6aeff40ab |
|
BLAKE2b-256 | 26fec8386bd629650c7f777455086295626713ca40e56271f091a26bed52f9a6 |
Close
Hashes for streamlit_dynamic_filters-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e4f000d2cd9408fcdb9b64063084c5c2b75fa54d1d3bded730dbd26c3f5140e |
|
MD5 | e9ecc479715be14e6463efdac04e9815 |
|
BLAKE2b-256 | 7d5254a471f676d9219435fdd4330360beb61dceb668e187f308f4ed85dcef06 |