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 maps Python dictionary to Redis server.

Installation

Simply you can install it from PyPi by following command:

pip install -U redisary

or if you prefer the latest development version, you can install it from the source:

git clone https://github.com/xurvan/redisary.git
cd redisary
python setup.py install

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

  • <input type="checkbox" checked="" disabled="" /> Map Redis 'string' to Python 'str'
  • <input type="checkbox" disabled="" /> Map Redis 'list' to Python 'list'
  • <input type="checkbox" disabled="" /> Map Redis 'hash' to Python 'dict'
  • <input type="checkbox" disabled="" /> Map Redis 'set' to Python 'set'
  • <input type="checkbox" disabled="" /> 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.

Files for redisary, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size redisary-0.1.2-py3-none-any.whl (6.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size redisary-0.1.2.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page