Skip to main content

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

Project description

PyPI Version Build Status

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.

Maintainers

Extentions

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

redis-limpyd-0.2.1.tar.gz (64.6 kB view details)

Uploaded Source

Built Distribution

redis_limpyd-0.2.1-py3-none-any.whl (42.7 kB view details)

Uploaded Python 3

File details

Details for the file redis-limpyd-0.2.1.tar.gz.

File metadata

File hashes

Hashes for redis-limpyd-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5a4d4b0de710081efc237ebd25fb72e3c759c3a89b09c772e0c305dfd0f27951
MD5 0779bd45cda1873632d6a4072882ea1d
BLAKE2b-256 a5fe7abd54fa35804e1316cd5e1e6a891a411544128f73ecb7efaedf7be66460

See more details on using hashes here.

File details

Details for the file redis_limpyd-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for redis_limpyd-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d16b99edf49a17abf8652f65902e6eb2a1a174712cddf38a7078c05be51fe175
MD5 d76a72e642e50eb5c352f5ce66c364ee
BLAKE2b-256 8396a113146d7d3df476e0f24ba6261da1ba5ab261df1de47465c415b8d228e8

See more details on using hashes here.

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