Streamlit URL fragment
A fork of ktosiek/streamlit-url-fragment that adds the ability to get the hash as a dictionary if it is in the correct format.
Get the URL fragment (the part of URL after #) in your Streamlit script:
import streamlit as st
from streamlit_url_fragments import get_fragments
current_value = get_fragments()
st.write(f"Current value: {get_fragments()}")
Warning: the first value you'll get will be a None - that means the component is still loading.
You can wait for the correct value with if current_value is None: st.stop().
This fork adds the ability to get the hash as a dictionary if it is in the correct format. Please make sure to test the type returned by the function before using it.
import streamlit as st
from streamlit_url_fragments import get_fragments
current_value = get_fragments()
if isinstance(current_value, dict):
st.write("The function returned a dictionary.")
elif isinstance(current_value, str):
st.write("The function returned a string.")
else:
st.write(f"The function returned an unexpected type: {type(current_value)}")
st.write(f"Current value: {current_value}")
Metadata
Release files for streamlit-url-fragments 0.1.2
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_url_fragments-0.1.2.tar.gz | 676.6 kB | Without provenance | Details for streamlit_url_fragments-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| streamlit_url_fragments-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for streamlit_url_fragments-0.1.2-py3-none-any.whl |
Total release size: 1.4 MB
Release files / streamlit_url_fragments-0.1.2.tar.gz
| Download URL | streamlit_url_fragments-0.1.2.tar.gz |
|---|---|
| Size | 676.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bad30847b48b28d9c15959434b2727a66bfb14e4d76bcb18f56e5d27f483c09
|
|
BLAKE2b-256 checksum How to use checksums |
ef63fb005555ea3a9110bf681f84009b1d80e86a531f7193c8c2b7155c815e37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / streamlit_url_fragments-0.1.2-py3-none-any.whl
| Download URL | streamlit_url_fragments-0.1.2-py3-none-any.whl |
|---|---|
| Size | 687.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
357262404e54e39b93d7ee930e6c5212c328dd7fd648d4a010c4f4e0e46dd6f9
|
|
BLAKE2b-256 checksum How to use checksums |
0076189645f9887dbafbaf10b6453fd5a06b839c5f81d31a1e0e886e2ea9e62e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Security for streamlit-url-fragments 0.1.2
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.