An Object-Redis Mapping
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
coralillo-2.2.0.tar.gz
(26.5 kB
view hashes)
Built Distribution
coralillo-2.2.0-py3-none-any.whl
(32.3 kB
view hashes)
Close
Hashes for coralillo-2.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca0c558b38a2e94afdb7b72b91993378b340793c21f859ca7a0931ad7b6a7e66 |
|
MD5 | 34de37281621b69626cd247b5bd6cff3 |
|
BLAKE2b-256 | 5d66f1b8106f41b6c3093ce2680000b15b39cb7f11d85fef06844ede3883a727 |