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.
It also supports moving items between multiple containers.
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 multiple_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
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-sortables-0.1.0.tar.gz.
File metadata
- Download URL: streamlit-sortables-0.1.0.tar.gz
- Upload date:
- Size: 369.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.1 Darwin/21.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbeb6b6c25387bcd2e25d1d59b67aefada2a58ecc12e938f5a5a630bf4ad8a80
|
|
| MD5 |
607e5cbd0266e88a1b00b6c7f997aa66
|
|
| BLAKE2b-256 |
cd8b48ab71d1f3d5218eb205a5f87eac57caff3fb93bf98ef23ebcfbeb182670
|
File details
Details for the file streamlit_sortables-0.1.0-py3-none-any.whl.
File metadata
- Download URL: streamlit_sortables-0.1.0-py3-none-any.whl
- Upload date:
- Size: 376.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.1 Darwin/21.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a500f26a23160bdad1df119d540c18a19131301aebe6513ee84025c9e0e2ef86
|
|
| MD5 |
34c5c484c8fd044c38c2107662cbac1b
|
|
| BLAKE2b-256 |
ab2e867531bf06560b2c154a209902534b732e373d56defdfdb78ac0ae99a46f
|