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

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.HashableField(indexable=True, unique=True)
    color = model.HashableField()
    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

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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for redis-limpyd-0.1.2.tar.gz
Algorithm Hash digest
SHA256 84945d85892b2bc11c64e64088239f3648cce41ad4c9ea55f85da76307a63a8d
MD5 96694707758287933283c65f59275f2f
BLAKE2b-256 438a962ce45c49dabd91e86c30f20b553cf059b2b838bfb56219ba94f0025d1a

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