Dataclass-wizard

Latest version: v0.34.0

Safety actively analyzes 693883 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 8 of 11

0.12.0

-------------------

* Change the order of arguments for :func:`fromdict` and :func:`fromlist`
functions, since it's more intuitive to pass the name of the data class
as the first argument.

* Add :func:`fromlist`, :func:`fromdict`, and :func:`asdict` to the public API,
and ensure that we export these helper functions.

* Add new helper functions :func:`LoadMeta` and :func:`DumpMeta` to specify
the meta config for a dataclass, which can be used with the new functions
like ``fromdict`` above.

* *Custom key mappings*: support a use case where we want to specify a new
mapping via the ``__remapping__`` key in the ``metadata`` argument to
:func:`dataclasses.field`.

0.11.0

-------------------

* Add the ability to handle unknown or extraneous JSON keys in the *load* (de-serialization)
process. A new attribute ``raise_on_unknown_json_key`` to the ``Meta`` class
determines if we should raise an error in such cases.

* Move attribute definition for the ``JSONWizard.Meta`` class into a new
:class:`BaseMeta` definition, so that the model can be re-used in
`loaders` and `dumpers` module for example.

* Ensure all errors raised by this library extend from a new base error class,
:class:`JSONWizardError`.

* Add new error classes

* :class:`MissingFields` - raised when JSON object is missing a required
dataclass field.
* :class:`UnknownJSONKey` - raised when an unknown or extraneous JSON key is
encountered in the JSON load process.

* Split up the load (de-serialization) process for *named tuples* into two
helper load hooks. The new hook :meth:`load_to_named_tuple_untyped` is used
for the ``collections.namedtuple`` variant.

* Minor performance improvements so the JSON load process is slightly faster.

0.10.2

-------------------

* Rename some internal functions, such as the ``default_func`` decorator (renamed
to ``_alias``). I felt that this name was overall more clearer.
* Similarly rename ``PassThroughParser`` to ``SingleArgParser``, as that's a bit
more clear which types it handles.
* ``wiz`` CLI: comment out the *--verbose* and *--quiet* flags, as those were
unused anyway.
* Update docs/

0.10.0

-------------------

* Minor performance improvements so the JSON load process is slightly faster.
* ``wiz gs``: The result now includes the :class:`JSONWizard` import and the
expected usage by default.
* Update type annotations slightly for the ``LoadMixin.load_to...`` methods.
* Add support for sub-classes of common Python types, such as subclasses of
``str`` and ``int``, as part of the JSON load process.
* Remove ``ForwardRefParser`` - we don't need it anyway as it's a simple
resolution, and the usage of a ``Parser`` object incurs a bit of an
unnecessary overhead.

0.9.0

------------------
**Features and Improvements**

* Minor performance improvements so the JSON load process is slightly faster.
* Replace ``CaseInsensitiveDict`` with a custom ``DictWithLowerStore`` implementation.
* ``wiz`` CLI: Add a ``--version`` option to check the installed version.
* Remove :func:`get_class_name` usage wherever possible.

**Bugfixes**

* Fixes for the JSON to dataclass generation tool
- Ensure that nested lists with dictionaries are correctly merged, and add a test
case to confirm intended behavior.
- Change to only singularize model names if nested within a list.

0.8.2

------------------
**Bugfixes**

* ``wiz gs``: Empty lists should appear as ``List`` instead of ``Dict``

Page 8 of 11

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.