A simple component to display annotated text in Streamlit apps.
Project description
Annotated Text Component for Streamlit
A simple component to display annotated text in Streamlit apps. For example:
Or, even better, check out our demo app here:
Installation
First install Streamlit (of course!) then pip-install this library:
pip install streamlit
pip install st-annotated-text
Example
import streamlit as st
from annotated_text import annotated_text
annotated_text(
"This ",
("is", "verb"),
" some ",
("annotated", "adj"),
("text", "noun"),
" for those of ",
("you", "pronoun"),
" who ",
("like", "verb"),
" this sort of ",
("thing", "noun"),
"."
)
For more examples, including :sparkles:customization options:sparkles:, see the demo app.
Parameters
The annotated_text()
function accepts any number of the following arguments:
- strings, to draw the string as-is on the screen.
- tuples of the form (main_text, annotation_text, background, color) where background and foreground colors are optional and should be an CSS-valid string such as "#aabbcc" or "rgb(10, 20, 30)"
- htbuilder.HtmlElement objects in case you want to customize
the annotations further. In particular, you can import the
annotation()
function from this module to easily produce annotations whose CSS you can customize via keyword arguments. - lists of any of the above -- or of lists!
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
File details
Details for the file st_annotated_text-4.0.2.tar.gz
.
File metadata
- Download URL: st_annotated_text-4.0.2.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b0134dcf734697cc3dbdb11862c4174071e7fb6f365af55a37c710d357fd88a5
|
|
MD5 |
2cd58527254cb906919ee629395d6212
|
|
BLAKE2b-256 |
4d76c0f64a56b779bfb5c87437687a9970d12dad37b5aea2541823d0c5010818
|
Provenance
The following attestation bundles were made for st_annotated_text-4.0.2.tar.gz
:
Publisher:
publish.yml
on tvst/st-annotated-text
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
st_annotated_text-4.0.2.tar.gz
-
Subject digest:
b0134dcf734697cc3dbdb11862c4174071e7fb6f365af55a37c710d357fd88a5
- Sigstore transparency entry: 164881442
- Sigstore integration time:
-
Permalink:
tvst/st-annotated-text@bbb2209cbd609dd3eade11f76065dc5e797de777
-
Branch / Tag:
refs/tags/v4.0.2
- Owner: https://github.com/tvst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yml@bbb2209cbd609dd3eade11f76065dc5e797de777
-
Trigger Event:
release
-
Statement type:
File details
Details for the file st_annotated_text-4.0.2-py3-none-any.whl
.
File metadata
- Download URL: st_annotated_text-4.0.2-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
712c45821f020eccafad3a58c10b9d2d51d449f4db999a06308ecf39a753a4df
|
|
MD5 |
1f1a2676358b657f98e25086400044fe
|
|
BLAKE2b-256 |
d970f29d4359ddfd1a0afa00065e4dac32bd4931f589185f5f0f499db9aee4fe
|
Provenance
The following attestation bundles were made for st_annotated_text-4.0.2-py3-none-any.whl
:
Publisher:
publish.yml
on tvst/st-annotated-text
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
st_annotated_text-4.0.2-py3-none-any.whl
-
Subject digest:
712c45821f020eccafad3a58c10b9d2d51d449f4db999a06308ecf39a753a4df
- Sigstore transparency entry: 164881449
- Sigstore integration time:
-
Permalink:
tvst/st-annotated-text@bbb2209cbd609dd3eade11f76065dc5e797de777
-
Branch / Tag:
refs/tags/v4.0.2
- Owner: https://github.com/tvst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yml@bbb2209cbd609dd3eade11f76065dc5e797de777
-
Trigger Event:
release
-
Statement type: