Skip to main content

Tags custom component for Streamlit

Project description

Streamlit-tags

A custom component to have Tags in Streamlit. image

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

Try out a demo here: Streamlit App

Check out docs here:

Updates

Now streamlit tags also supports theming and all the colours

image

Install

pip install streamlit-tags

The installation can also be found on PyPi

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,
            key=None) -> list
  '''

    :param label: (Str) Label of the Function
    :param text: (Str) Instructions for entry
    :param value: (List) Initial Value
    :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
    '''

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

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

    :param label: (Str) Label of the Function
    :param text: (Str) Instructions for entry
    :param value: (List) Initial Value
    :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: Tags
    '''

Example Usage

import streamlit as st
from streamlit_tags import st_tags

keywords = st_tags('Enter Keyword:', 'Press enter to add more', ['One', 'Two', 'Three'])

st.write(keywords)

UI for st_tags

image

UI for st_tags_sidebar

image

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_tags-1.1.5.tar.gz (558.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_tags-1.1.5-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file streamlit_tags-1.1.5.tar.gz.

File metadata

  • Download URL: streamlit_tags-1.1.5.tar.gz
  • Upload date:
  • Size: 558.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for streamlit_tags-1.1.5.tar.gz
Algorithm Hash digest
SHA256 7953dccd65e523848c088f70039c0a57aa3e4e8ade94506aba32a6ef729af307
MD5 6c3c7cfe2c7b2aa2f8f48d0fc084c277
BLAKE2b-256 83d9bdf362c3871cbc6a76f4e0ef7bf46a202c1951efc8d5c51c08054c727c88

See more details on using hashes here.

File details

Details for the file streamlit_tags-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: streamlit_tags-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for streamlit_tags-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 98e85c687a1aa4525c83139598e9a6d943d577072fd92e78d734039a4da7b368
MD5 6c7f2a531caf1048d894df180359de27
BLAKE2b-256 2e1a108d81b13ba0791a9da9fd433ad129fc7aab702d632dd58d43518996c6af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page