Skip to main content

ImplicitDict base class that turns a subclass into a dict indexing attributes, making [de]serialization easy for complex typing-annotated data types.

Project description

implicitdict

This library primarily provides the ImplicitDict base class which enables the inheriting class to implicitly be treated like a dict with entries corresponding to the fields of the inheriting class. Simple example:

class MyData(ImplicitDict):
    foo: str
    bar: int = 0
    baz: Optional[float]

data: MyData = ImplicitDict.parse({'foo': 'asdf', 'bar': 1}, MyData)
assert json.dumps(data) == '{"foo": "asdf", "bar": 1}'

See class documentation for ImplicitDict and test_normal_usage.py for more information.

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

implicitdict-4.1.0.tar.gz (53.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

implicitdict-4.1.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file implicitdict-4.1.0.tar.gz.

File metadata

  • Download URL: implicitdict-4.1.0.tar.gz
  • Upload date:
  • Size: 53.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for implicitdict-4.1.0.tar.gz
Algorithm Hash digest
SHA256 afa39b97180993c0c8a75bccb72fa05f14a8db7550ffc18d92a3a2717396701b
MD5 29d9facd39103a0fe9e94c19fe41b59b
BLAKE2b-256 0942657eac38a6f71090790a8399decb4c6a8243136cebc7929c18c8c0df0613

See more details on using hashes here.

File details

Details for the file implicitdict-4.1.0-py3-none-any.whl.

File metadata

  • Download URL: implicitdict-4.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for implicitdict-4.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e550f55aafe933e3132ec0dc9fe68e686dc2060d5ba676bf54f748cfd5fedfd0
MD5 03b514ae69d0311637aaa16ee0c86cd2
BLAKE2b-256 da0e9382537211f4009a99de7b6c005d52b55ee789c245b9e9a77015edd36958

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page