Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.
/ strictus Public archive

Distant relative of Biggus Dickus, rewrite of strictus-dictus, inspired by dataclasses, powered by type hints, standing on the elephants of shoulders.

Notifications You must be signed in to change notification settings

jbasko/strictus

Repository files navigation

strictus

A much tested rewrite of strictus-dictus (github repo) which does not extend dict.

Installation

pip install strictus

Usage

from typing import List

from strictus.core import strictus, strictus_field


class Item(strictus):
    id: str
    name: str


class ItemList(strictus):
    items: List[Item] = strictus_field(default_factory=list)


item_list = ItemList({"items": [{"id": 1, "name": "first"}]})
print(item_list.items[0].name)  # prints "first"
print(item_list.to_dict())  # prints "{'items': [{'id': '1', 'name': 'first'}]}"

About

Distant relative of Biggus Dickus, rewrite of strictus-dictus, inspired by dataclasses, powered by type hints, standing on the elephants of shoulders.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages