Skip to main content

Streamlit component that allows you to do manage local storage

Project description

Streamlit local storage

This repo is to help streamlt users manage data in a browser's local storage.

pip install streamlit-local-storage

from streamlit_local_storage import LocalStorage localS = LocalStorage()

store an array to local storage

localStorageArray = [ {"key":"Games", "toStore":[{"name":"Basically does this work"}]}, {"key":"Winners", "toStore":[{"name":"Basically does this work Though"}]} ] localS.setList(localStorageArray)

store individual items from local storage

itemKey = "camera" itemValue = "Tarah" localS.set(itemKey, itemValue)

get list of items from local storage

data_ = [{"key":"camera"}, {"key":"JamesLook"}] saved_ = localS.getList(data_) st.write(saved_)

get all items saved on local storage

saved_individual = localS.getAll() st.write(saved_individual)

delete item and item list from local storage

saved_individual = localS.deleteList([{"key": "ThomasKing"}, {"key":"Somethingelse"}]) localS.deleteItem('Tony')

delete all

localS.deleteAll()

get all

localS.getAll()

Remember to refresh browser if it does not pop up instantly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit-local-storage-0.0.3.tar.gz (441.9 kB view hashes)

Uploaded Source

Built Distribution

streamlit_local_storage-0.0.3-py3-none-any.whl (446.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page