
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.