Skip to content

errant/meritous

Repository files navigation

PyPI PyPI - Python Version PyPI - License Codecov Code Climate maintainability

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)

About

Simple, agnostic approach to Models in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages