caution: This is intended for an interactive shell environment, not as a library to interface with your production Redis database. You should probably use redis-py for that.
redisobj has unittests with 100% coverage
Download or fork on github
Get it here: https://github.com/gumuz/redisobj
Connecting to a Redis database
A RedisDB object can be used like an ordinary Python dictionary object.
Getting and setting
Be careful, this deletes all keys from the current database.
Just like a normal dictionary, a KeyError will be raised when accessing a non-existing key.
The only accepted values are string, integer, list, set or dictionary.
The list, set and dict types can only contain string or integer values.
Integers can be set, but will always be returned as strings.
Lists can contain integers, but integer values will always be returned as strings.
Sets can contain integers, but integer values will always be returned as strings.
Hashes (dictionaries) can contain integers, but integer values will always be returned as strings. Keys should always be strings.
Currently, all operations work on the DB level. Future addition could include bound datatypes, where operations on the values themselves will be translated to redis commands, directly altering the values in the DB.blog comments powered by Disqus