Streamlit-tags

pypi Version conda Version PyPi downloads Conda downloads

A custom component to add Tags in Streamlit.

ezgif com-gif-maker (1)

Please star⭐ the repo and share the usage if you liked it.

Try out a demo here: |Streamlit App|

Check out docs here: https://streamlit-tags.readthedocs.io/en/latest/

Install

PyPi

::

   pip install streamlit-tags

The installation can also be found on `PyPi`_

Anaconda
~~~~



conda install -c gagan3012 streamlit-tags

The installation can also be found on Anaconda

Usage

This library has two main functions to display and use tags:

  • st_tags to display the tags feature

  • st_tags_sidebar to display the tags in the sidebar

Check the examples/_ folder of the project a quick start.

Check out demo here: https://share.streamlit.io/gagan3012/streamlit-tags/examples/app.py

Definition

def st_tags(label: str,
            text: str,
            value: list,
            suggestions: list,
            key=None) -> list:
    '''

    :param suggestions: (List) List of possible suggestions (optional)
    :param label: (Str) Label of the Function
    :param text: (Str) Instructions for entry
    :param value: (List) Initial Value (optional)
    :param key: (Str)
        An optional string to use as the unique key for the widget.
        Assign a key so the component is not remount every time the script is rerun.
    :return: (List) Tags

    Note: usage also supports keywords = st_tags()

    '''

Note:

  • The suggestion and value fields are optional

  • Usage also supports keywords = st_tags()

We also have a function now to embed the tags function to the sidebar: ~~~~~~~~~~~~~~