Simple Python Models
Project description
Meritous
Meritous is an absurdly simply approach to "Models" in Python.
It came about because there is no modern, framework agnostic approach to modelling data.
On the face of it the usage is very trivial; but the intent is that Meritous is a building block for more complex data models. Essentially, it provides a simple Model class which can contain data to be used in Python applications. It then sets out a standard practice for transforming that data for storage or transport.
Installation
pip install meritous
Basic Usage
from meritous.core import Model
from meritous.core.properties import UUIDProperty, StrProperty, DateProperty
from datetime import date
class EventModel(Model):
_schema = {
"id" : UUID4Property(),
"title" : StrProperty(),
"date" : DateProperty(),
"description" : StrProperty(),
}
event = EventModel()
event.title = 'Sample Event'
event.date = date.fromisoformat('2023-01-10')
print(event.id)
print(event.title)
print(event.date)
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
meritous-1.2.2.tar.gz
(14.7 kB
view details)
Built Distribution
File details
Details for the file meritous-1.2.2.tar.gz
.
File metadata
- Download URL: meritous-1.2.2.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 690a13c1fc47c791d1a40b6f508be929dfc1b7cbfd89801b5f10a6eecd4afb21 |
|
MD5 | 4100d14c180527f8d4c404b4e0bb4e78 |
|
BLAKE2b-256 | 26c90daf61ef116cd2f7ff459889a04a237f1908855a4a180c5a974c915f0fe7 |
File details
Details for the file meritous-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: meritous-1.2.2-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ca97260bd1a8360da881b38e602b73b32b85afaace16334f2334be3ecdda99a |
|
MD5 | bfc2b23bd11547480a9d935b26eca8c3 |
|
BLAKE2b-256 | 13e67fd440bd64e0164210a9d0041306b14876f20005bbf9fa5a233565d4c302 |