streamlit-sortables


Namestreamlit-sortables JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/ohtaman/streamlit-sortables
SummaryA Streamlit component to provide sortable list.
upload_time2023-02-09 21:46:09
maintainer
docs_urlNone
authorohtaman
requires_python>=3.8,<4.0
licenseMIT
keywords streamlit sortable list
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```python
$ pip install streamlit-sortables
```

## Usage

Call `soretd_items` method with a list of string. Return value is the sorted items.

```python
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`.

```python

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}')
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ohtaman/streamlit-sortables",
    "name": "streamlit-sortables",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "streamlit,sortable,list",
    "author": "ohtaman",
    "author_email": "ohtamans@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/29/2e/2a4446c658f351dde078ae9a80c7aa448cf3178032671d1ce16e25388931/streamlit_sortables-0.2.0.tar.gz",
    "platform": null,
    "description": "# Streamlit Sortables\n\nA Streamlit component to provide sortable list.\nYou can sort the list of strings on the UI as follows.\n\nhttps://user-images.githubusercontent.com/329750/163662202-ce292fc4-2882-46ac-8c2c-ca4b9df675d2.mp4\n\n\n## Instllation\n\n```python\n$ pip install streamlit-sortables\n```\n\n## Usage\n\nCall `soretd_items` method with a list of string. Return value is the sorted items.\n\n```python\nimport streamlit as st\nfrom streamlit_sortables import sort_items\n\n\noriginal_items = ['A', 'B', 'C']\nsorted_items = sort_items(original_items)\n\nst.write(f'original_items: {original_items}')\nst.write(f'sorted_items: {sorted_items}')\n```\n\nYou can pass list of dicts with `multi_containers=True`.\n\n```python\n\nimport streamlit as st\nfrom streamlit_sortables import sort_items\n\noriginal_items = [\n    {'header': 'first container',  'items': ['A', 'B', 'C']},\n    {'header': 'second container', 'items': ['D', 'E', 'F']}\n]\n\nsorted_items = sort_items(original_items, multiple_contaieners=True)\n\nst.write(f'original_items: {original_items}')\nst.write(f'sorted_items: {sorted_items}')\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Streamlit component to provide sortable list.",
    "version": "0.2.0",
    "split_keywords": [
        "streamlit",
        "sortable",
        "list"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eeb117d14a93f37ac146601787a88f350bf58c4afaaa113279e5963e40c51eba",
                "md5": "87c67e0d5aa5f0a0d2a5aa510b07bfda",
                "sha256": "62dcac58eb25ff12a7cce748d2b56d20fdb917d93bffd6d008f96bc96b920018"
            },
            "downloads": -1,
            "filename": "streamlit_sortables-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "87c67e0d5aa5f0a0d2a5aa510b07bfda",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 657738,
            "upload_time": "2023-02-09T21:46:07",
            "upload_time_iso_8601": "2023-02-09T21:46:07.301630Z",
            "url": "https://files.pythonhosted.org/packages/ee/b1/17d14a93f37ac146601787a88f350bf58c4afaaa113279e5963e40c51eba/streamlit_sortables-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "292e2a4446c658f351dde078ae9a80c7aa448cf3178032671d1ce16e25388931",
                "md5": "72f2078a0b481103c25afc60197f2b0b",
                "sha256": "b82b3e27255a7f02b25c97a5d212edc067aff5613ce568e4fecb17bb98daffd0"
            },
            "downloads": -1,
            "filename": "streamlit_sortables-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "72f2078a0b481103c25afc60197f2b0b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 648874,
            "upload_time": "2023-02-09T21:46:09",
            "upload_time_iso_8601": "2023-02-09T21:46:09.953878Z",
            "url": "https://files.pythonhosted.org/packages/29/2e/2a4446c658f351dde078ae9a80c7aa448cf3178032671d1ce16e25388931/streamlit_sortables-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-09 21:46:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ohtaman",
    "github_project": "streamlit-sortables",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "streamlit-sortables"
}
        
Elapsed time: 0.05397s