A package to store data on hard disk (HD) and make it available to all Python applications running in parallel!
Project description
pylocalstorage
A package to store data on hard disk (HD) and make it available to all Python applications running in parallel!
Requirements
>=python 2.7
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("country", "Brazil")
my_storage.setItem("city", "Manaus")
print(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("city")
print(my_storage.getItem("city"))
# Retrieving all existing keys
for i in range(my_storage.length):
print(my_storage.key(i))
# Cleaning up LocalStorage
my_storage.clear()
print(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.1.tar.gz
(3.6 kB
view hashes)