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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afa39b97180993c0c8a75bccb72fa05f14a8db7550ffc18d92a3a2717396701b
|
|
| MD5 |
29d9facd39103a0fe9e94c19fe41b59b
|
|
| BLAKE2b-256 |
0942657eac38a6f71090790a8399decb4c6a8243136cebc7929c18c8c0df0613
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e550f55aafe933e3132ec0dc9fe68e686dc2060d5ba676bf54f748cfd5fedfd0
|
|
| MD5 |
03b514ae69d0311637aaa16ee0c86cd2
|
|
| BLAKE2b-256 |
da0e9382537211f4009a99de7b6c005d52b55ee789c245b9e9a77015edd36958
|