Skip to main content

Small and dummy DB-API 2 data mapper

Project description

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)

Project details


Download files

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

Source Distribution

albus-0.0.2.tar.gz (9.8 kB view hashes)

Uploaded Source

Built Distribution

albus-0.0.2-py3-none-any.whl (12.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page