streamlit-localstorage-bulk
Handles localstorage with Streamlit.
Significant performance improvements can be expected due to batch javascript execution.
Support python3 only.
Examples
import streamlit as st
from streamlit_localstorage_bulk import StreamlitLocalstorageBulk
def main():
sl = StreamlitLocalstorageBulk(
prefix="st_localstorage_",
)
v = sl.get_items(keys=["ability", "goals", "a"])
st.write(v)
if st.button("setitem"):
sl.setitems(data={"a": "A"})
if st.button("delitem"):
sl.delitems(keys=["a"])
if __name__ == "__main__":
main()
Installation
pip install streamlit-localstorage-bulk
CI
install test package
$ ./scripts/ci.sh install
test
$ ./scripts/ci.sh run-test
flake8 and black and pytest.
release pypi
$ ./scripts/ci.sh release
git tag and pypi release.