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'}]}"
Release files for strictus 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| strictus-1.0.2.tar.gz | 8.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| strictus-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.9 kB
Release files / strictus-1.0.2.tar.gz
| Download URL | strictus-1.0.2.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fbfd7aee4b573902c899397504b617995a269210f7d1ee2bdbae3ca33451991
|
|
BLAKE2b-256 checksum How to use checksums |
e8ff29b7b835a281bed7d94740a99186a8cbfce0784011f3e8ec555f2df444b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Release files / strictus-1.0.2-py3-none-any.whl
| Download URL | strictus-1.0.2-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c08425b08ab911c3f79ff9f41f3ee791a74c73ff8f2b3cffcb6f72473b207f84
|
|
BLAKE2b-256 checksum How to use checksums |
89179ef2627a1871ec84be0365ec11db39eb305888ea53999498691b266054a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|