A package to store data on the hard disk (HD) and make it available to all Python applications running locally!
Version based on the pickle module. The pickle module implements binary protocols for serializing and de-serializing a Python object structure.
Simply install pylocalstorage package from PyPI
$ pip install pylocalstorage
>>> from pylocalstorage import LocalStorage
>>> ls = LocalStorage()
>>> ls.setItem("name", "David")
>>> ls.setItem("age", 29)
>>> ls.setItem("address", {"country": "Brazil", "city": "Manaus"})
>>> ls.length
3
>>> ls.setItem("name", "David Ferreira")
>>> ls.getItem("name")
'David Ferreira'
>>> ls.removeItem("name")
>>> import numpy as np
>>> arr = np.zeros((1080, 1920, 3), dtype=np.uint8)
>>> ls.setItem("array", arr)
>>> for i in range(ls.length):
... print(ls.key(i))
...
'address'
'age'
'array'
>>> ls.clear()
>>> ls.length
0