Skip to main content

Limpyd provides an easy way to store objects in Redis, without losing the

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 --process-dependency-links redis-limpyd

Note: the process-dependency-links is currently required to use a development version of future which correct a bug we suffered from.

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.0.tar.gz (65.2 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for redis-limpyd-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b407473d49e3eede09e59dfe37830cf1d913782aa8e8273ddd976e4da3e2d2bd
MD5 fcffbf929ff0a5fa0f7da542591fbb15
BLAKE2b-256 0caf8a4e1e9910d30902791a0c9d0b0a4b3293172f411daded38d6a914b38d1d

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