Skip to content
This repository was archived by the owner on Aug 22, 2022. It is now read-only.

Repository files navigation

persistentdict

Yet another [1] dictionary backed by Redis DB.

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

Usage:

frompersistentdict.dict_in_redisimportPersistentDictdb=PersistentDict(hash_name="my-persistent-dict")
# add key to the db with a valuedb['key'] =value# show whole dictionaryprint(db)
# iterate over keys & values in dbforkey, valueindb.items():
do_something(key)
# do sth with key if it is in dbifkeyindb:
do_something(key)
# delete key from dbdeldb['key']

Installation:

pip3 install persistentdict

[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

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages