A Streamlit component to provide sortable list.
Project description
Streamlit Sortables
A Streamlit component to provide sortable list. You can sort the list of strings on the UI as follows.
https://user-images.githubusercontent.com/329750/163662202-ce292fc4-2882-46ac-8c2c-ca4b9df675d2.mp4
Instllation
$ pip install streamlit-sortables
Usage
Call soretd_items
method with a list of string. Return value is the sorted items.
import streamlit as st
from streamlit_sortables import sort_items
original_items = ['A', 'B', 'C']
sorted_items = sort_items(original_items)
st.write(f'original_items: {original_items}')
st.write(f'sorted_items: {sorted_items}')
You can pass list of dicts with multi_containers=True
.
import streamlit as st
from streamlit_sortables import sort_items
original_items = [
{'header': 'first container', 'items': ['A', 'B', 'C']},
{'header': 'second container', 'items': ['D', 'E', 'F']}
]
sorted_items = sort_items(original_items, multiple_contaieners=True)
st.write(f'original_items: {original_items}')
st.write(f'sorted_items: {sorted_items}')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
streamlit_sortables-0.2.0.tar.gz
(648.9 kB
view hashes)
Built Distribution
Close
Hashes for streamlit_sortables-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b82b3e27255a7f02b25c97a5d212edc067aff5613ce568e4fecb17bb98daffd0 |
|
MD5 | 72f2078a0b481103c25afc60197f2b0b |
|
BLAKE2b-256 | 292e2a4446c658f351dde078ae9a80c7aa448cf3178032671d1ce16e25388931 |
Close
Hashes for streamlit_sortables-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62dcac58eb25ff12a7cce748d2b56d20fdb917d93bffd6d008f96bc96b920018 |
|
MD5 | 87c67e0d5aa5f0a0d2a5aa510b07bfda |
|
BLAKE2b-256 | eeb117d14a93f37ac146601787a88f350bf58c4afaaa113279e5963e40c51eba |