Skip to main content

Yet another dictionary backed by Redis DB

Project description

persistentdict

Yet another [1] dictionary backed by Redis DB.

We use Redis` 'hash' type [2] and store whole dictionary in one hash.

Usage:

from persistentdict import PersistentDict

db = PersistentDict(hash_name="my-persistent-dict")

# add key to the db with a value
db['key'] = value

# show whole dictionary
print(db)

# iterate over keys & values in db
for key, value in db.items():
  do_something(key)

# do sth with key if it is in db
if key in db:
  do_something(key)

# delete key from db
del db['key']

[1] Alternatives: persistent-dict, durabledict

[2] https://redis.io/topics/data-types-intro#hashes is basically Python's dict, but values can be strings only, so we use json serialization

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for persistentdict, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size persistentdict-1.0.0.tar.gz (6.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page