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 versions 2.6, 2.7, 3.3 and 3.4 are supported. Redis-py versions >= 2.9.1, < 2.11 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.4.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

redis_limpyd-0.2.4-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for redis-limpyd-0.2.4.tar.gz
Algorithm Hash digest
SHA256 e8d175ee85cc0aac3fe7b848c04283724226a5a5831c9f69b6e1321c987010d8
MD5 1be3a1259e8930f989a089e86504efb9
BLAKE2b-256 e3336e05f3d58e458c9feaea418579cd7a7a237dd26777be7535c6e3ece0a8be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for redis_limpyd-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e918eeb58b8561600919945e94dda66efe605d8bef8120d35ce4920dca6e0e09
MD5 3af35120f17f029374fe387b45fb7ed9
BLAKE2b-256 91dba163d16ab4cce6f4e097c42c8a0d40209d8bfcfb0ce0cd7c4d50abb24b1e

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