Streamlit-tags
A custom component to add Tags in Streamlit.
Please Upgrade to 1.2.7 version
📢 Favour:
It would be highly motivating, if you can STAR⭐ this repo if you find it helpful.
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 conda-forge streamlit_tags
The installation can also be found on Anaconda
Usage
This library has two main functions to display and use tags:
st_tagsto display the tags featurest_tags_sidebarto display the tags in the sidebar Check theexamples/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(value: list,
suggestions: list,
label: str,
text: str,
maxtags: int,
key=None) -> list:
'''
:param maxtags: Maximum number of tags allowed maxtags = -1 for unlimited entries
: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
Note:
- The suggestion and value fields are optional
- Usage also supports
keywords = st_tags() - Upgrade to 1.1.9 for being able to control number of tags
We also have a function now to embed the tags function to the sidebar:
def st_tags_sidebar(value: list,
suggestions: list,
label: str,
text: str,
maxtags: int,
key=None) -> list:
'''
:param maxtags: Maximum number of tags allowed maxtags = -1 for unlimited entries
: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: Tags
'''
Note:
- The suggestion and value fields are optional
- Usage also supports
keywords = st_tags_sidebar() - Upgrade to 1.1.9 for being able to control number of tags
Example Usage
keywords = st_tags(
label='# Enter Keywords:',
text='Press enter to add more',
value=['Zero', 'One', 'Two'],
suggestions=['five', 'six', 'seven',
'eight', 'nine', 'three',
'eleven', 'ten', 'four'],
maxtags = 4,
key='1')
keyword = st_tags_sidebar(
label='# Enter Keywords:',
text='Press enter to add more',
value=['Zero', 'One', 'Two'],
suggestions=['five', 'six', 'seven',
'eight', 'nine', 'three',
'eleven', 'ten', 'four'],
maxtags = 4,
key='1')
Sample Images of the UI:
We hit 10000 downloads!!
Metadata
Release files for streamlit-tags 1.2.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| streamlit_tags-1.2.8.tar.gz | 561.2 kB | Without provenance | Details for streamlit_tags-1.2.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| streamlit_tags-1.2.8-py3-none-any.whl | Python 3 | none | any | Details for streamlit_tags-1.2.8-py3-none-any.whl |
Total release size: 3.2 MB
Security for streamlit-tags 1.2.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.