Skip to main content

Model class with attributes validation

Project description

PY BASE MODEL

codecov

Model data validator

Examples

Model with primitive type attributes

from base_model.base_model import BaseModel

class PrimitiveFieldsModel(BaseModel):
    id: int
    name: str
    active: bool
    size: float

Model with time type attributes

from datetime import datetime, date, time

from base_model.base_model import BaseModel


class TimeFieldsModel(BaseModel):
    birthday: date
    register: datetime
    alarm: time

Model with list type attributes

from typing import List

from base_model.base_model import BaseModel


class ListFieldsModel(BaseModel):
    names: List[str]
    ages: List[int]
    enables: List[bool]

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

base-model-guiosoft-0.0.3.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

base_model_guiosoft-0.0.3-py3-none-any.whl (8.8 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