Skip to main content

Strictus (a rewrite of Strictus Dictus)

Project description

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'}]}"

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

strictus-1.0.2.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

strictus-1.0.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file strictus-1.0.2.tar.gz.

File metadata

  • Download URL: strictus-1.0.2.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for strictus-1.0.2.tar.gz
Algorithm Hash digest
SHA256 1fbfd7aee4b573902c899397504b617995a269210f7d1ee2bdbae3ca33451991
MD5 37ba305498f12d44f4eb1a0623e33e5d
BLAKE2b-256 e8ff29b7b835a281bed7d94740a99186a8cbfce0784011f3e8ec555f2df444b0

See more details on using hashes here.

File details

Details for the file strictus-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: strictus-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for strictus-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c08425b08ab911c3f79ff9f41f3ee791a74c73ff8f2b3cffcb6f72473b207f84
MD5 4b3cd5063231b63a639c61ae0561a496
BLAKE2b-256 89179ef2627a1871ec84be0365ec11db39eb305888ea53999498691b266054a3

See more details on using hashes here.

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