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

  • 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.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redisary-0.1.2-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file redisary-0.1.2.tar.gz.

File metadata

  • Download URL: redisary-0.1.2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.3

File hashes

Hashes for redisary-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8991d023d94e952ecc20c4af3cff7efb34ff8a055c82a934611954464a0ba23f
MD5 3ae16c323e7af28c605a0869d42f7dfc
BLAKE2b-256 51afaaf9524ff03ab7dd3f4eaa5a4efb1b9cc83beb15ef7e1cd49e11e1e672b5

See more details on using hashes here.

File details

Details for the file redisary-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: redisary-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.3

File hashes

Hashes for redisary-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8adc6ecd5491fec34d1b14a25795ae1aeab9fceae2d43b6e16e142b3140f3927
MD5 70e1ef0166d124f7a89e5ec42397ac09
BLAKE2b-256 13bc1385f1c2e8897d72e73947802e8caef86c47b9153f67a8bf11e81a7d769f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page