Basics: Get, Set, Delete
The Notebook Analogy
A BasicStore is like a notebook where you write labels and information:
- Set = Write a new entry (or erase and rewrite an existing one)
- Get = Look up an entry by its label
- Delete = Erase an entry
- Exists = Check if a label is in the notebook (without reading it)
- Keys = List every label in the notebook
Creating a Store
That's it! You now have an empty notebook ready to use.
Setting Values
If you set a key that already exists, the old value is replaced:
Getting Values
If the key doesn't exist, you get an error:
To avoid the error, use get_or_default:
Deleting Values
store.delete("name") # Returns True (it existed)
store.delete("name") # Returns False (already gone)