A package to store data on the hard disk (HD) and make it available to all Python applications running locally!
Project description
pylocalstorage
A package to store data on the hard disk (HD) and make it available to all Python applications running locally!
Requirements
Python 2.7 or higher
Installation
Simply install pylocalstorage package from PyPI
pip install pylocalstorage
Examples
from pylocalstorage import LocalStorage
# Connecting to LocalStorage
my_storage = LocalStorage()
# Creating three items
my_storage.setItem("name", "David")
my_storage.setItem("age", 29)
my_storage.setItem("address", {
"country": "Brazil",
"city": "Manaus"
})
print("Number of items:", my_storage.length)
# Updating an item
my_storage.setItem("name", "David Ferreira")
# Getting an item
print(my_storage.getItem("name"))
# Removing an item
my_storage.removeItem("name")
# Retrieving all existing keys
for i in range(my_storage.length):
print(my_storage.key(i))
# Cleaning up LocalStorage
my_storage.clear()
print("Number of items:", my_storage.length)
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 Distribution
pylocalstorage-1.0.3.tar.gz
(3.7 kB
view hashes)