Skip to main content

Redis as dictionary

Project description

Redisary

Redis is a key-value database. Interestingly Python dictionaries are some how key-value data structure. So why not write a wrapper that map Python dictionary to Redis server.

Installation

pip install -U https://github.com/xurvan/redict/archive/master.zip

Quickstart

A very simple usage could be like:

from redisary import Redisary

redis = Redisary(host='127.0.0.1', db=0)

redis['k'] = 'data'
data = redis['k']

Well it works like a normal dictionary, the only advantage is data now stored on Redis and we could access it from another process.

We also could set an expire for all keys of dictionary:

from redisary import Redisary

redis = Redisary(expire=800)

redis['k'] = 'temporary'

TODO

  • Map Redis 'string' to Python 'str'
  • Map Redis 'list' to Python 'list'
  • Map Redis 'hash' to Python 'dict'
  • Map Redis 'set' to Python 'set'
  • Map Redis 'sorted set' to something!

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

redisary-0.1.0.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

redisary-0.1.0-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

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