skip to navigation
skip to content

Not Logged In

redis-limpyd 0.2.1

Limpyd provides an easy way to store objects in Redis, without losing the power and the control of the Redis API, in a limpid way, with just as abstraction as needed.

Limpyd

Limpyd provides an easy way to store objects in Redis, without losing the power and the control of the Redis API, in a limpid way, with just as abstraction as needed.

Featuring:

  • Don’t care about keys, limpyd do it for you
  • Retrieve objects from some of their attributes
  • Retrieve objects collection
  • CRUD abstraction
  • Keep the power of all the Redis data types in your own code

Example of configuration:

from limpyd import model

main_database = model.RedisDatabase(
    host="localhost",
    port=6379,
    db=0
)

class Bike(model.RedisModel):

    database = main_database

    name = model.InstanceHashField(indexable=True, unique=True)
    color = model.InstanceHashField()
    wheels = model.StringField(default=2)

So you can use it like this:

>>> mountainbike = Bike(name="mountainbike")
>>> mountainbike.wheels.get()
'2'
>>> mountainbike.wheels.incr()
>>> mountainbike.wheels.get()
'3'
>>> mountainbike.name.set("tricycle")
>>> tricycle = Bike.collection(name="tricycle")[0]
>>> tricycle.wheels.get()
'3'
>>> tricycle.hmset(color="blue")
True
>>> tricycle.hmget('color')
['blue']
>>> tricycle.hmget('color', 'name')
['blue', 'tricycle']
>>> tricycle.color.hget()
'blue'
>>> tricycle.color.hset('yellow')
True
>>> tricycle.hmget('color')
['yellow']

Install

Python 2.6, 2.7, 3.3 and 3.4 are supported.

pip install redis-limpyd

Documentation

See https://redis-limpyd.readthedocs.org/ for a full documentation.

Extentions

 
File Type Py Version Uploaded on Size
redis-limpyd-0.2.1.tar.gz (md5) Source 2015-01-12 63KB
redis_limpyd-0.2.1-py3-none-any.whl (md5) Python Wheel 3.4 2015-01-12 41KB
  • Downloads (All Versions):
  • 9 downloads in the last day
  • 119 downloads in the last week
  • 392 downloads in the last month