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.

Source Distribution

persistentdict-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file persistentdict-1.0.0.tar.gz.

File metadata

  • Download URL: persistentdict-1.0.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for persistentdict-1.0.0.tar.gz
Algorithm Hash digest
SHA256 35c71cb98a420df7ea5a516c0536f14b5273cad6436cbbf3f217d7117cdbd855
MD5 4c7e5c672f0005997bbc4db7534c01ba
BLAKE2b-256 5eea956467974520a4ecfb6c297d589e983624684cf98dc1e0aac44d1dc528bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page