Streamlit Component for handling local storage
Project description
Streamlit Local Storage Handler
Streamlit Local Storage Handler is a Streamlit component that allows you to interact with the local storage of the user's browser. You can set, get, remove, and clear items in the local storage using this component.
Installation
To install the component, you need to have npm and Node.js installed. Then, follow these steps:
-
Install the Python package:
pip install st-storage-handler
Usage
from st_storage_handler import st_storage_handler
Methods
-
Creation of Key, Value pairs in the local storage
st_storage_handler.set_item(set_keys: dict, widket_key: str)
set_keys
: A dictionary of key, value pairs to be set in the local storage.widget_key
: A unique key for the widget. -> needs to be unique for each widget (if you have multiple widgets using the same key, they will all be updated when one of them is updated)
-
Retrieving the value of a key from the local storage
st_storage_handler.get_item(key: str, widket_key: str)
key
: The key of the value to be retrieved from the local storage.widget_key
: A unique key for the widget. -> needs to be unique for each widget (if you have multiple widgets using the same key, they will all be updated when one of them is updated)
-
Removing a key from the local storage
st_storage_handler.remove_item(key: str, widket_key: str)
key
: The key of the value to be removed from the local storage.widget_key
: A unique key for the widget. -> needs to be unique for each widget (if you have multiple widgets using the same key, they will all be updated when one of them is updated)
-
Clearing the local storage
st_storage_handler.clear(widket_key: str)
widget_key
: A unique key for the widget. -> needs to be unique for each widget (if you have multiple widgets using the same key, they will all be updated when one of them is updated)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file st_storage_handler-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: st_storage_handler-0.0.1-py3-none-any.whl
- Upload date:
- Size: 501.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfd85e2433d7023ee4e7de1b8bd558e6407fd03d0485c4bde60c5a6e9a399640 |
|
MD5 | 6135681959ee650121b2543b8d649f21 |
|
BLAKE2b-256 | d83b3a10a5c57017f168e5c461a2c7069fe6f0a938b00bdc7c169bdcf7e60730 |