Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

gotnotable/albus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

albus

ARCHIVED NOTICE

Looks like the underlying problem was understimated here. The main motivation was to actually have a really simple data mapper where you would not need to care about fields details neither how to compose queries. Everything was supposed to be simple method calls with few arguments.

Even though the interface was not actually defined, and the idea was to define it on the go, one challenge was clear right away and not easy to overcome: the engines to access underlying databases. Even if that could be accomplished, the security breaches and bugs that the project would need to overcome to mature are tremendous.

Albus

This Python data mapper library was created thinking on simplicity learning and using it. As opposed to other ORM options, this one will not be as powerful and flexible in terms of queries. That is the trade-off to make it simpler to learn and use.

Usage

Defining models is done using property descriptors as you would for SQLAlchemy and Django. Querying them is completely different in regards to how we avoid overriding Python operators or using dynamic keyword arguments.

from albus.model import Model
from albus import field


class Book(Model):

    author = field.StringField()
    title = field.StringField()
    year = field.IntegerField()


query = Book.new_query()
query.filter_equals('author', 'John Doe')
query.filter_greater('year', 2000)

results = query.select()
for current in results:
    print('Found:', current.title)

About

Simple and limited Data Mapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages