Skip to main content

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.

Project description

PyPI Version Build Status Doc 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

  • Powerful indexing and filtering

  • 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.7 and 3.5 to 3.8 are supported (CPython and PyPy).

Redis-py versions >= 3 are supported, with redis-server versions >= 3.

pip install redis-limpyd

For Redis-py versions < 3, please use limpyd version 1.3.1 (or later in 1.x versions)

Documentation

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

Changelog

See CHANGELOG.rst

Maintainers

Extensions

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

Uploaded Source

Built Distribution

redis_limpyd-2.1-py2.py3-none-any.whl (74.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: redis-limpyd-2.1.tar.gz
  • Upload date:
  • Size: 67.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.4.1 requests/2.14.2 setuptools/34.2.0 requests-toolbelt/0.7.1 clint/0.5.1 CPython/2.7.12+ Linux/4.10.0-43-generic

File hashes

Hashes for redis-limpyd-2.1.tar.gz
Algorithm Hash digest
SHA256 d34e84e3b34c2c993c9b988e2a2822fb1565edd539f53e09353b3ddc8f2902bb
MD5 5346f94a1f9dce1556ac0dc925b8d72d
BLAKE2b-256 14e9745e6e337bfeb66aa550d0ac215d380d34ef21c8c8df3870570c1946a8d7

See more details on using hashes here.

File details

Details for the file redis_limpyd-2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: redis_limpyd-2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 74.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.4.1 requests/2.14.2 setuptools/34.2.0 requests-toolbelt/0.7.1 clint/0.5.1 CPython/2.7.12+ Linux/4.10.0-43-generic

File hashes

Hashes for redis_limpyd-2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d28568f50e54abd6993215d6f25086f3a9b370f7f10a3d033379d251203b30dc
MD5 01fedcb51ce81d184cb86bf3dd967930
BLAKE2b-256 4a557818ff53a3c8d839ebb5992ac1988391dc809fb39bdc7dc127a7ab049a1f

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