Skip to main content

An Object-Redis Mapping

Project description

Build Status

A redis ORM.

Notes

Version 1.0 depends on redis >= 3.0.

Installation

$ pip install coralillo

Usage

from coralillo import Engine, Model, fields

# Create the engine
eng = Engine()

# Declare your models
class User(Model):
    name      = fields.Text()
    last_name = fields.Text()
    email     = fields.Text(
        index=True,
        regex='^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,}$',
    )

    class Meta:
        engine = eng

# Persist objects to database
john = User(
    name='John',
    last_name='Doe',
    email='john@example.com',
).save()

# Query by index
mary = User.get_by('email', 'mary@example.com')

# Retrieve all objects
users = User.all()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for coralillo, version 2.2.1
Filename, size File type Python version Upload date Hashes
Filename, size coralillo-2.2.1-py3-none-any.whl (32.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size coralillo-2.2.1.tar.gz (26.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page