◐ Shell
clean mode source ↗

An ActiveRecord ORM for Python

An ActiveRecord ORM for Python Developers

Orator

The Orator ORM provides a simple yet beautiful ActiveRecord implementation.

class Dream(Model):
    """
    Think big...
    """

    @belongs_to
    def you(self):
        return Dreamer
from orator import Model, SoftDeletes


class User(SoftDeletes, Model):

    __fillable__ = ['name', 'email']

    @has_many
    def posts(self):
        return Post
ActiveRecord at hand

A Beautiful ORM

The Orator ORM is based on conventions to avoid the hassle of defining every single aspect of your models.

Relationships are also a breeze to setup.

Write beautiful code

Expressive Syntax

Write readable and expressive code using the ORM or the low-level Query Builder.

And if it's not enough, you can use raw queries.

user = User.where('name', 'John').first()
user.name = 'Simon'
user.save()

# Eager load relationships
post = Post.with_('comments').first()
for comment in post.comments:
    print(comment.title)

# Use the query builder directly
db.table('users').insert(name="Cleo", email='cleo@cleo.com')