/persistent-dict

📂 A Python dict which stores all data in Redis

Primary LanguagePythonMIT LicenseMIT

NOTICE: If you're reading this on GitHub.com please be aware this is a mirror of the primary remote located at https://code.richard.do/explore/projects. Please direct issues and pull requests there.

persistent-dict

PyPI Python Versions Build Status

A Python Dict which stores data in Redis.

You can use RedisDict exactly like a normal dict. As long as all the keys and values in it are picklable.

Installation

To install, simply:

pip install persistent-dict

How to use

import redis
from persistentdict import RedisDict

mydict = RedisDict(persistence=redis.StrictRedis())

# with a specific storage key in redis
mydict = RedisDict(persistence=redis.StrictRedis(), key='stuff')

mydict['hello'] = 'world'

print(mydict)
{'hello': 'world'}

Future plans

  • Support for other storage backends other than Redis.