
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
streamlit-state-attribute
Advanced tools
A lightweight utility to bind class attributes directly to Streamlit's session state, making it easy to persist and share values across reruns.
Contents
Instead of using st.session_state["some_key"], define a typed attribute of some class which is automatically synced
with the session state.
from streamlit_state_attribute import StateAttribute
import streamlit as st
class SomeWidget:
some_attribute: str = StateAttribute(default="test")
some_widget = SomeWidget()
some_widget.some_attribute = "3"
assert st.session_state["SomeWidget.some_attribute"] == "3"
st.session_state is abstracted awayuv pip install streamlit-state-attribute
import streamlit as st
from streamlit_state_attribute import StateAttribute
class SomeWidgetWithKey:
key: str
some_attribute: str = StateAttribute(default="test", unique_attribute="key")
def __init__(self, key: str) -> None:
self.key = key
# Each key will have a separate State
other_widget = SomeWidgetWithKey(key="test")
other_widget.some_attribute = "4"
assert st.session_state["SomeWidgetWithKey.test.some_attribute"] == "4"
See also counter.py and global_state.py.
Made to play around with descriptors after a workshop descriptors at Pycon2025.
FAQs
A lightweight utility to bind class attributes directly to Streamlit's session state, making it easy to persist and share values across reruns.
We found that streamlit-state-attribute demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.