Small and dummy DB-API 2 data mapper
Project description
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
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
albus-0.0.2.tar.gz
(9.8 kB
view details)
Built Distribution
albus-0.0.2-py3-none-any.whl
(12.7 kB
view details)
File details
Details for the file albus-0.0.2.tar.gz
.
File metadata
- Download URL: albus-0.0.2.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1030a420e2c930fd3212a8fd5b20e62496edbfca75543cd124fe5120cbeac8d |
|
MD5 | 22867aff35751da93ae6faff785f099f |
|
BLAKE2b-256 | 12cfe1ab18eda9adccd836225799b1ac0d4cf27258a798ab43eef1c62bc9fb2d |
File details
Details for the file albus-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: albus-0.0.2-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6bd50520d70cd0f2c7da757d8967ea1b014f7efbb0a6b15fa51ae23a5b45b0a |
|
MD5 | f0af8657a1f74ce73ffc26f69f82b1ee |
|
BLAKE2b-256 | 78c1f94cba95bb79383cc8cc6c49dc8f4fce8f521e6d3aa92bdc11be5223c815 |