Skip to content

📂 A Python dict which stores all data in Redis

License

Notifications You must be signed in to change notification settings

richardARPANET/persistent-dict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.