skip to navigation
skip to content

Not Logged In


Lightweight python ORM (Object-relational mapper).

Latest Version:

Autumn exists as a super-lightweight Object-relational mapper (ORM) for Python. Autumn ORM follows the KISS principle. It’s an alternative to SQLObject, SQLAlchemy, Storm, etc. Perhaps the biggest difference is the automatic population of fields as attributes (see the example below), and minimal size. Autumn as small as possible.

It is released under the MIT License (see LICENSE file for details).

This project is currently considered beta software.

PostgreSQL Example

Using these tables:

CREATE TABLE autumn_tests_models_author (
    id serial NOT NULL PRIMARY KEY,
    first_name VARCHAR(40) NOT NULL,
    last_name VARCHAR(40) NOT NULL,
    bio TEXT
    id serial NOT NULL PRIMARY KEY,
    title VARCHAR(255),
    author_id integer REFERENCES autumn_tests_models_author(id) ON DELETE CASCADE

Put in your PYTHONPATH file with your settings. See file autumn/ for more details.

You can also set the settings directly:

import autumn.settings
autumn.settings.DATABASES = {
    'default': {
        'engine': "postgresql",
        'user': "devel",
        'database': "devel_autumn",
        'password': "devel",
        'debug': True,
        'initial_sql': "SET NAMES 'UTF8';",
        'thread_safe': True,

We setup our objects like so:

from autumn.model import Model, ForeignKey, OneToMany

class Author(Model):

    class Meta:
        defaults = {'bio': 'No bio available'}
        validations = {'first_name': (
            lambda v: len(v) > 1 or "Too short first name",
            lambda self, key, value: value != self.last_name or "Please, enter another first name",

class Book(Model):
    author = ForeignKey(Author, related_name='books')

    class Meta:
        db_table = 'books'

Now we can create, retrieve, update and delete entries in our database. Creation

james = Author(first_name='James', last_name='Joyce')

u = Book(title='Ulysses',


a = Author.get(1)
a.first_name # James
a.books      # Returns list of author's books

# Returns a list, using LIMIT based on slice
a = Author.get()[:10]   # LIMIT 0, 10
a = Author.get()[20:30] # LIMIT 20, 10


a = Author.get(1) = 'What a crazy guy! Hard to read but... wow!'



SQLBuilder integration

ta = Author.s
tb = Book.s
qs = tb.qs

object_list = qs.tables(
    qs.tables() & ta.on(tb.author_id ==
    (ta.first_name != 'James') & (ta.last_name != 'Joyce')

QuerySet based on sqlbuilder.smartsql, see more info.

Signals support

  • pre_init
  • post_init
  • pre_save
  • post_save
  • pre_delete
  • post_delete
  • class_prepared


You can use Autumn ORM with lightweight web-frameworks, like wheezy.web, Bottle, Tornado, pysi, etc.


File Type Py Version Uploaded on Size
autumn2- (md5) Source 2013-12-08 15KB
  • Downloads (All Versions):
  • 53 downloads in the last day
  • 497 downloads in the last week
  • 2162 downloads in the last month