streamlit-gov-uk-components
A collection of Streamlit components that use or are inspired by the GOV.UK Design System
Installation
pip install streamlit-gov-uk-components
Usage
Checkbox (example)
import streamlit as st
from streamlit_gov_uk_components import gov_uk_checkbox
selected = gov_uk_checkbox(
label="Waste from animal carcasses", # Label shown in browser
id="waste-from-animal-carcases", # ID of checkbox in HTML
key="waste-from-animal-carcases", # Streamlit component instance key
default=True, # Initially selected?
)
Smaller checkbox (example)
import streamlit as st
from streamlit_gov_uk_components import gov_uk_checkbox_small
selected = gov_uk_checkbox_small(
label="HM Revenue and Customs (HMRC)", # Label shown in browser
id="hmrc", # ID of checkbox in HTML
key="hmrc", # Streamlit component instance key
default=True, # Initially selected?
)
Local development
The examples serve as reasonable mini Streamlit applications that allow development of the components themselves. Two terminal session are typically needed.
One to run Streamlit itself...
pip install streamlit
STREAMLIT_GOV_UK_COMPONENTS_DEV=True streamlit run example_checkbox.py
... and one to run a development server that automatically recompiles and serves the HTML and Javascript of the front end of each component.
cd streamlit_gov_uk_components/frontend_checkbox
yarn install
./fix.sh
yarn run start
Releasing to PyPI
-
Ensure that each frontend component has been built
cd streamlit_gov_uk_components/frontend_checkbox yarn install ./fix.sh yarn run build
-
Ensure that there is a line in
MANIFEST.infor each frontend component. -
Bump the version inside
setup.py -
Commit with a Conventional Commit message with the bumped version, tag the commit with the bumped version, and push to GitHub.
git add setup.py git commit -m "build(release): v0.0.4" git tag v0.0.4 git push origin main --tags
-
Build and release to PyPI
pip install build twine rm -r -f build dist && python3 -m build && python -m twine upload dist/*
Metadata
Release files for streamlit-gov-uk-components 0.0.4
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-gov-uk-components-0.0.4.tar.gz | 379.1 kB | Without provenance | Details for streamlit-gov-uk-components-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| streamlit_gov_uk_components-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for streamlit_gov_uk_components-0.0.4-py3-none-any.whl |
Total release size: 760.7 kB
Release files / streamlit-gov-uk-components-0.0.4.tar.gz
| Download URL | streamlit-gov-uk-components-0.0.4.tar.gz |
|---|---|
| Size | 379.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d24df8e8d57141463cd4bd45dea8d1345a4fe5c6a040021457919e517d2e01e9
|
|
BLAKE2b-256 checksum How to use checksums |
6e37755450c5121ae0af710064f1645073df13300110a7fedb4df5fef2d2933c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / streamlit_gov_uk_components-0.0.4-py3-none-any.whl
| Download URL | streamlit_gov_uk_components-0.0.4-py3-none-any.whl |
|---|---|
| Size | 381.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f89db6efb0520677e0222edd718a046e93a4612d9b124311ee8d16afc2d1fc48
|
|
BLAKE2b-256 checksum How to use checksums |
7e3980f5e9f076ad27ebf5463515f2303301e6685cec30ea3e46a21415323717
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Security for streamlit-gov-uk-components 0.0.4
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.