Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
a69d542
apply `@dataclass` decorator
rnag Dec 1, 2024
05c860a
add `pprint` for `__str__()`
rnag Dec 1, 2024
19771ff
Lotta Changes to `Load`, it's Supa Fast !!!
rnag Dec 2, 2024
054e71a
Fixing a bug
rnag Dec 2, 2024
0506731
move to `v1`
rnag Dec 2, 2024
1eaa45c
ive got deser for defaultdict, enum, uuid, decimal, and path working!
rnag Dec 2, 2024
c75ec73
minor changes
rnag Dec 2, 2024
7fef942
add support for time, date, datetime, and timedelta
rnag Dec 2, 2024
dad21ec
add support for namedtuple, NamedTuple
rnag Dec 4, 2024
5a6ae32
add support for TypedDict
rnag Dec 4, 2024
deb839e
add support for ReadOnly, Literal, Annotated, LiteralString
rnag Dec 4, 2024
862e5c0
fix for nested dataclasses
rnag Dec 6, 2024
68b3312
minor refactor and changes
rnag Dec 7, 2024
e2b8e88
feat: deserialize `Union` types
rnag Dec 7, 2024
4a5c281
feat: add `v1` and `v1_unsafe_parse_dataclass_in_union`
rnag Dec 8, 2024
a873b2b
feat: add `v1` and `v1_unsafe_parse_dataclass_in_union`
rnag Dec 8, 2024
7a27227
fix tests and disable auto `@dataclass` application
rnag Dec 8, 2024
813eba8
i think that fix it
rnag Dec 8, 2024
2eade44
i think that fix it
rnag Dec 8, 2024
989416b
Moar Updates
rnag Dec 8, 2024
accb219
minor changes and tests need be added
rnag Dec 8, 2024
56685f3
optimize missing fields
rnag Dec 9, 2024
bfff459
add support for key casing
rnag Dec 9, 2024
f970288
add support for aliases
rnag Dec 10, 2024
3a91837
partially add `raise_on_unknown_key` support
rnag Dec 10, 2024
2c6868d
fully add `raise_on_unknown_key` support
rnag Dec 11, 2024
dde2d83
add support for `CatchAll`
rnag Dec 11, 2024
9a7725a
fully support `CatchAll`
rnag Dec 11, 2024
1b5f8fe
add more test cases for coverage
rnag Dec 12, 2024
6477ad3
add benchmarks for catch all
rnag Dec 12, 2024
dba8877
update to use `pytest-benchmark`
rnag Dec 13, 2024
aaf2077
checkin changes so far
rnag Dec 17, 2024
492f84c
fix logic so its working
rnag Dec 17, 2024
9044407
completely fix `AliasPath`
rnag Dec 17, 2024
3f3287a
fix tests on CI
rnag Dec 17, 2024
4a0adc6
fix tests on CI
rnag Dec 17, 2024
b0f6bb8
fix tests on CI
rnag Dec 17, 2024
f7f3ef8
Merge branch 'main' into milestone-to-V1
rnag Dec 17, 2024
543f51a
try fix tests on CI
rnag Dec 17, 2024
2a901eb
try fix tests on CI
rnag Dec 17, 2024
5649da1
thats not the issue, ima have to try debug it locally
rnag Dec 17, 2024
03d3936
Im stupid, we need to use `is_subclass_safe` after all :o
rnag Dec 17, 2024
34dea81
I tire of this
rnag Dec 17, 2024
bd52f88
Update badges and docs
rnag Dec 17, 2024
48c6ade
Update docs to mention v1` opt-in
rnag Dec 17, 2024
9857586
update description
rnag Dec 17, 2024
b6671b9
one last change, think its good to go!
rnag Dec 17, 2024
9147fe0
add section on perf in v1
rnag Dec 17, 2024
58a1ad3
clean up comments
rnag Dec 17, 2024
ce60349
Update HISTORY.rst
rnag Dec 17, 2024
b75f9e5
Update HISTORY.rst and add Dark Mode for Docs!
rnag Dec 17, 2024
df96906
minor working udpates
rnag Dec 12, 2025
c3fe0a0
Merge remote-tracking branch 'origin/main' into milestone-to-V1
rnag Dec 13, 2025
995df6f
working now
rnag Dec 13, 2025
d7e3320
minor updates
rnag Dec 13, 2025
ed3bd9e
minor updates
rnag Dec 13, 2025
0a1271f
minor updates
rnag Dec 13, 2025
77dd7b9
minor updates
rnag Dec 13, 2025
7717bc5
minor updates
rnag Dec 13, 2025
da7b0d1
minor updates
rnag Dec 13, 2025
7f3e7fc
minor updates
rnag Dec 13, 2025
da5b715
minor updates
rnag Dec 13, 2025
b055891
minor updates
rnag Dec 13, 2025
aa1749c
minor updates
rnag Dec 13, 2025
0d0ee75
minor updates
rnag Dec 14, 2025
1980afe
minor updates
rnag Dec 14, 2025
cb414c8
Fix tests and `get_resolved_annotations` for property_wizard.py
rnag Dec 14, 2025
f993919
Fix tests
rnag Dec 14, 2025
0cb7f44
update docs
rnag Dec 14, 2025
6c29f5a
minor fixes
rnag Dec 14, 2025
851031b
minor fixes
rnag Dec 14, 2025
b8b28db
minor fixes
rnag Dec 14, 2025
13628e5
Merge remote-tracking branch 'origin/main' into milestone-to-V1
rnag Dec 14, 2025
96e4a29
minor fixes
rnag Dec 14, 2025
7e144b9
minor fixes
rnag Dec 14, 2025
2476604
minor fixes
rnag Dec 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@
History
=======


0.36.0 (2025-12-14)
------------------

**Features and Improvements**

* Introduce ``DataclassWizard`` as the preferred base class for the v1 API.
This class auto-applies the ``@dataclass`` decorator to subclasses, reducing
boilerplate and clarifying the recommended usage going forward.
* Add explicit v1 dump support via a new ``v1/dumpers.py`` implementation.
This refactor improves separation of concerns and results in better
serialization performance when v1 is enabled.
* Update default usage examples and documentation to reflect the new
``DataclassWizard`` API and explicit ``load_case`` / ``dump_case`` configuration.
* Fix annotation resolution for older Python versions by routing
through ``get_resolved_annotations()``.

**API Changes**

* Rename ``v1_key_case`` to ``v1_case`` for clarity and consistency with related
v1 configuration options.

**Internal Changes**

* Refactor v1 load/dump selection logic to route through the new v1 loader and
dumper pipeline when enabled.

0.35.4 (2025-12-12)
-------------------

Expand Down
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ for complex and *nested dataclass* models!
**Behold, the power of the Dataclass Wizard**::

>>> from __future__ import annotations
>>> from dataclasses import dataclass, field
>>> from dataclass_wizard import JSONWizard
>>> from dataclasses import field
>>> from dataclass_wizard import DataclassWizard
...
>>> @dataclass
... class MyClass(JSONWizard):
>>> # DataclassWizard auto-applies @dataclass to subclasses
... class MyClass(DataclassWizard, load_case='AUTO', dump_case='CAMEL'):
... my_str: str | None
... is_active_tuple: tuple[bool, ...]
... list_of_int: list[int] = field(default_factory=list)
Expand Down Expand Up @@ -1516,7 +1516,7 @@ What's New in v1.0
print(MyModel(my_field="value").to_dict())
# Output: {'my_field': 'value'}

- **Default __str__() Behavior Change**
- **Default __str__() Behavior Change**

Starting with **v1.0.0**, we no longer pretty-print the serialized JSON value with keys in ``camelCase``.
Instead, we now use the ``pprint`` module to handle serialization formatting.
Expand Down
32 changes: 16 additions & 16 deletions benchmarks/complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ def test_load(request, data, data_2, data_dacite, n):
"""
[ RESULTS ON MAC OS X ]

benchmarks.complex.complex - [INFO] dataclass-wizard 0.325364
benchmarks.complex.complex - [INFO] dataclass-factory 0.773195
benchmarks.complex.complex - [INFO] dataclasses-json 28.435088
benchmarks.complex.complex - [INFO] dacite 6.287875
benchmarks.complex.complex - [INFO] mashumaro 0.344701
benchmarks.complex.complex - [INFO] pydantic 0.547749
benchmarks.complex.complex - [INFO] jsons 29.978993
benchmarks.complex.complex - [INFO] jsons (strict) 34.052532
benchmarks.complex.complex - [INFO] dataclass-wizard 0.317641
benchmarks.complex.complex - [INFO] dataclass-factory 0.751124
benchmarks.complex.complex - [INFO] dacite 6.350958
benchmarks.complex.complex - [INFO] mashumaro 0.343612
benchmarks.complex.complex - [INFO] pydantic 0.538801
benchmarks.complex.complex - [INFO] dataclasses-json 28.214992
benchmarks.complex.complex - [INFO] jsons 31.735730
benchmarks.complex.complex - [INFO] jsons (strict) 34.855084
"""
g = globals().copy()
g.update(locals())
Expand Down Expand Up @@ -276,14 +276,14 @@ def test_dump(request, data, data_2, data_dacite, n):
"""
[ RESULTS ON MAC OS X ]

benchmarks.complex.complex - [INFO] dataclass-wizard 1.606120
benchmarks.complex.complex - [INFO] asdict (dataclasses) 2.006917
benchmarks.complex.complex - [INFO] dataclass-factory 0.979412
benchmarks.complex.complex - [INFO] dataclasses-json 13.740522
benchmarks.complex.complex - [INFO] mashumaro 0.289991
benchmarks.complex.complex - [INFO] pydantic 0.384267
benchmarks.complex.complex - [INFO] jsons 41.673240
benchmarks.complex.complex - [INFO] jsons (strict) 45.934885
benchmarks.complex.complex - [INFO] dataclass-wizard 0.405688
benchmarks.complex.complex - [INFO] asdict (dataclasses) 1.727631
benchmarks.complex.complex - [INFO] dataclass-factory 0.831178
benchmarks.complex.complex - [INFO] dataclasses-json 11.072727
benchmarks.complex.complex - [INFO] mashumaro 0.248298
benchmarks.complex.complex - [INFO] pydantic 0.316203
benchmarks.complex.complex - [INFO] jsons 37.361450
benchmarks.complex.complex - [INFO] jsons (strict) 31.578708
"""
c1 = MyClassWizard.from_dict(data)
c2 = factory.load(data_2, MyClass)
Expand Down
48 changes: 18 additions & 30 deletions benchmarks/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ def test_load(data, n):
"""
[ RESULTS ON MAC OS X ]

benchmarks.simple.simple - [INFO] dataclass-wizard 0.033917
benchmarks.simple.simple - [INFO] dataclass-factory 0.103837
benchmarks.simple.simple - [INFO] dataclasses-json 3.941902
benchmarks.simple.simple - [INFO] jsons 5.636863
benchmarks.simple.simple - [INFO] dacite 0.572661
benchmarks.simple.simple - [INFO] pydantic 0.081108
benchmarks.simple.simple - [INFO] marshmallow 2.550217
benchmarks.simple.simple - [INFO] attrs 0.022822
benchmarks.simple.simple - [INFO] mashumaro 0.046641
benchmarks.simple.simple - [INFO] dataclass-wizard 0.030784
benchmarks.simple.simple - [INFO] dataclass-factory 0.103156
benchmarks.simple.simple - [INFO] dataclasses-json 3.512702
benchmarks.simple.simple - [INFO] jsons 4.709339
benchmarks.simple.simple - [INFO] dacite 0.468830
benchmarks.simple.simple - [INFO] pydantic 0.071347
benchmarks.simple.simple - [INFO] marshmallow 2.155037
benchmarks.simple.simple - [INFO] attrs 0.020167
benchmarks.simple.simple - [INFO] mashumaro 0.041291
"""
g = globals().copy()
g.update(locals())
Expand Down Expand Up @@ -131,30 +131,18 @@ def test_dump(data, n):
"""
[ RESULTS ON MAC OS X ]

benchmarks.simple.simple - [INFO] dataclass-wizard 0.072549
benchmarks.simple.simple - [INFO] asdict (dataclasses) 0.101621
benchmarks.simple.simple - [INFO] dataclass-factory 0.087357
benchmarks.simple.simple - [INFO] dataclasses-json 1.488334
benchmarks.simple.simple - [INFO] jsons 8.550752
benchmarks.simple.simple - [INFO] dataclass-wizard 0.024619
benchmarks.simple.simple - [INFO] asdict (dataclasses) 0.093137
benchmarks.simple.simple - [INFO] dataclass-factory 0.188235
benchmarks.simple.simple - [INFO] dataclasses-json 1.294685
benchmarks.simple.simple - [INFO] jsons 6.913666
benchmarks.simple.simple - [INFO] dacite (not applicable) -- skipped
benchmarks.simple.simple - [INFO] pydantic 0.080157
benchmarks.simple.simple - [INFO] marshmallow 0.000578
benchmarks.simple.simple - [INFO] attrs 0.146561
benchmarks.simple.simple - [INFO] mashumaro 0.010199
benchmarks.simple.simple - [INFO] pydantic 0.066996
benchmarks.simple.simple - [INFO] marshmallow 0.000519
benchmarks.simple.simple - [INFO] attrs 0.122752
benchmarks.simple.simple - [INFO] mashumaro 0.008702
"""

# [ RESULTS ]
# benchmarks.simple.simple - [INFO] dataclass-wizard 0.065604
# benchmarks.simple.simple - [INFO] asdict (dataclasses) 0.087785
# benchmarks.simple.simple - [INFO] dataclass-factory 0.084215
# benchmarks.simple.simple - [INFO] dataclasses-json 1.278573
# benchmarks.simple.simple - [INFO] jsons 6.192119
# benchmarks.simple.simple - [INFO] dacite (not applicable) -- skipped
# benchmarks.simple.simple - [INFO] pydantic 0.066679
# benchmarks.simple.simple - [INFO] marshmallow 0.000481
# benchmarks.simple.simple - [INFO] attrs 0.122282
# benchmarks.simple.simple - [INFO] mashumaro 0.009025

c1 = MyClassWizard.from_dict(data)
c2 = factory.load(data, MyClass)
c3 = MyClassDJ.from_dict(data)
Expand Down
7 changes: 4 additions & 3 deletions dataclass_wizard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@

__all__ = [
# Base exports
'DataclassWizard',
'JSONSerializable',
'JSONPyWizard',
'JSONWizard',
Expand Down Expand Up @@ -120,17 +121,17 @@

from .bases_meta import LoadMeta, DumpMeta, EnvMeta
from .constants import PACKAGE_NAME
from .dumpers import DumpMixin, setup_default_dumper, asdict
from .dumpers import DumpMixin, setup_default_dumper
from .loaders import LoadMixin, setup_default_loader
from .loader_selection import fromlist, fromdict
from .loader_selection import asdict, fromlist, fromdict
from .models import (env_field, json_field, json_key, path_field, skip_if_field,
KeyPath, Container,
Pattern, DatePattern, TimePattern, DateTimePattern,
CatchAll, SkipIf, SkipIfNone,
EQ, NE, LT, LE, GT, GE, IS, IS_NOT, IS_TRUTHY, IS_FALSY)
from .environ.wizard import EnvWizard
from .property_wizard import property_wizard
from .serial_json import JSONWizard, JSONPyWizard, JSONSerializable
from .serial_json import DataclassWizard, JSONWizard, JSONPyWizard, JSONSerializable
from .wizard_mixins import JSONListWizard, JSONFileWizard, TOMLWizard, YAMLWizard


Expand Down
Loading