Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
5f75ce3
Add `v0/` package
rnag Jan 6, 2026
282ab0e
cleanup `v0` files
rnag Jan 6, 2026
50d1641
initial checkin of `v1` (get it workin')
rnag Jan 6, 2026
21e0cde
cleanup unnecessary files
rnag Jan 6, 2026
375e081
cleanup unnecessary files
rnag Jan 6, 2026
2bc579d
cleanup unnecessary vars
rnag Jan 6, 2026
fe47594
fix tests
rnag Jan 7, 2026
c6312fb
fix tests
rnag Jan 7, 2026
4b7c94c
fix tests
rnag Jan 7, 2026
6ba98fb
fix tests
rnag Jan 7, 2026
4b6eec9
move tests
rnag Jan 7, 2026
466dc56
move tests
rnag Jan 7, 2026
63d1da6
add stubs
rnag Jan 7, 2026
64a1fae
rename files
rnag Jan 7, 2026
50e2871
cleanup
rnag Jan 8, 2026
7ec6f84
cleanup
rnag Jan 8, 2026
295e820
cleanup
rnag Jan 8, 2026
3b316e2
add stubs
rnag Jan 8, 2026
1e5287f
add stubs
rnag Jan 8, 2026
971b2b5
refactor
rnag Jan 8, 2026
3a3fae8
refactor
rnag Jan 8, 2026
2f88a20
refactor
rnag Jan 8, 2026
710c0ca
refactor to fix circular imports
rnag Jan 8, 2026
c170703
refactor
rnag Jan 8, 2026
8b1d8a4
refactor
rnag Jan 8, 2026
2a0a205
refactor
rnag Jan 12, 2026
49cea27
refactor
rnag Jan 13, 2026
8c05aae
refactor
rnag Jan 13, 2026
3e8ff5f
refactor
rnag Jan 13, 2026
dc93c57
refactor
rnag Jan 14, 2026
19ca377
refactor to remove `v1_` naming for Meta
rnag Jan 14, 2026
2ac0658
refactor
rnag Jan 14, 2026
65f10b2
refactor
rnag Jan 14, 2026
28bf57e
refactor
rnag Jan 14, 2026
d2bc39b
refactor
rnag Jan 14, 2026
551b37d
refactor
rnag Jan 14, 2026
8ebdd3b
refactor
rnag Jan 14, 2026
1c1a6f5
refactor
rnag Jan 14, 2026
81fb344
refactor
rnag Feb 4, 2026
9e1649c
refactor
rnag Feb 4, 2026
e20d71f
refactor
rnag Feb 4, 2026
2e315fc
refactor
rnag Feb 4, 2026
e3ad6ad
refactor
rnag Feb 4, 2026
0275d51
refactor
rnag Feb 4, 2026
3612b1a
refactor
rnag Feb 4, 2026
af74138
refactor
rnag Feb 4, 2026
c9ab374
refactor
rnag Feb 4, 2026
319523f
refactor
rnag Feb 4, 2026
f7310ba
refactor
rnag Feb 4, 2026
0c441cb
refactor
rnag Feb 4, 2026
33d47e4
refactor
rnag Feb 4, 2026
234b959
refactor
rnag Feb 4, 2026
8abbbde
refactor
rnag Feb 5, 2026
02dcebd
refactor
rnag Feb 5, 2026
7257e71
refactor
rnag Feb 5, 2026
9a940ae
refactor
rnag Feb 10, 2026
bc94832
refactor
rnag Feb 10, 2026
67c51ba
fix mypy
rnag Feb 12, 2026
08f1502
fix mypy
rnag Feb 12, 2026
cfc7c1d
refactor mixins
rnag Feb 12, 2026
34776a1
refactor
rnag Feb 12, 2026
cfd91a0
refactor
rnag Feb 17, 2026
c5ab8b6
refactor
rnag Feb 18, 2026
0a307ef
remove method `register_type()`
rnag Feb 18, 2026
c492be8
refactor
rnag Feb 19, 2026
9bb8184
refactor
rnag Feb 19, 2026
117c402
refactor
rnag Feb 19, 2026
ea1adf4
refactor
rnag Feb 19, 2026
b81336c
refactor
rnag Feb 19, 2026
e711861
refactor
rnag Feb 19, 2026
f069f4a
refactor
rnag Feb 19, 2026
a8d3c90
ruff check
rnag Feb 20, 2026
90803c5
ruff check
rnag Feb 20, 2026
fdb07c0
ruff check
rnag Feb 20, 2026
c2f638e
ruff check
rnag Feb 20, 2026
b1bbaeb
ruff check
rnag Feb 20, 2026
c0f887c
ruff check
rnag Feb 20, 2026
dd2c672
ruff check
rnag Feb 20, 2026
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
35 changes: 21 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org

# top-most EditorConfig file
# https://editorconfig.org
root = true

[*]

indent_style = space
indent_size = 4

# Unix-style newlines with a newline ending every file
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[*.{html,css,js,json,sh,yml,yaml}]
indent_size = 2

[*.bat]
indent_style = tab
end_of_line = crlf

[{*.yml,*.yaml}]
indent_size = 2

[LICENSE]
insert_final_newline = false

[Makefile]
indent_style = tab
indent_size = unset

# Ignore binary or generated files
[*.{png,jpg,gif,ico,woff,woff2,ttf,eot,svg,pdf}]
charset = unset
end_of_line = unset
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
max_line_length = unset

[*.{diff,patch}]
trim_trailing_whitespace = false
7 changes: 4 additions & 3 deletions benchmarks/complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
import mashumaro

from dataclass_wizard import JSONWizard, LoadMeta
from dataclass_wizard.class_helper import create_new_class
from dataclass_wizard._type_utils import create_new_class
from dataclass_wizard.constants import PY314_OR_ABOVE
from dataclass_wizard.utils.string_conv import to_snake_case
from dataclass_wizard.utils.type_conv import as_datetime
from dataclass_wizard.utils._string_case import to_snake_case
# FIXME
from dataclass_wizard.cli.schema import _as_datetime as as_datetime


log = logging.getLogger(__name__)
Expand Down
9 changes: 6 additions & 3 deletions benchmarks/nested.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
import mashumaro

from dataclass_wizard import JSONWizard, LoadMeta
from dataclass_wizard.class_helper import create_new_class
from dataclass_wizard._type_utils import create_new_class
from dataclass_wizard.constants import PY314_OR_ABOVE
from dataclass_wizard.utils.string_conv import to_snake_case
from dataclass_wizard.utils.type_conv import as_datetime, as_date
from dataclass_wizard.utils._string_case import to_snake_case
# FIXME
from dataclass_wizard.cli.schema import (
_as_datetime as as_datetime,
_as_date as as_date)


log = logging.getLogger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import mashumaro

from dataclass_wizard import JSONWizard, LoadMeta
from dataclass_wizard.class_helper import create_new_class
from dataclass_wizard._type_utils import create_new_class
from dataclass_wizard.constants import PY314_OR_ABOVE
from dataclass_wizard.utils.string_conv import to_snake_case
from dataclass_wizard.utils._string_case import to_snake_case

log = logging.getLogger(__name__)

Expand Down
92 changes: 10 additions & 82 deletions dataclass_wizard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
>>> from datetime import datetime
>>> from typing import Optional
>>>
>>> from dataclass_wizard import JSONSerializable, property_wizard
>>> from dataclass_wizard import JSONWizard
>>> from dataclass_wizard.properties import property_wizard
>>>
>>>
>>> @dataclass
>>> class MyClass(JSONSerializable, metaclass=property_wizard):
>>> class MyClass(JSONWizard, metaclass=property_wizard):
>>>
>>> my_str: Optional[str]
>>> list_of_int: list[int] = field(default_factory=list)
Expand All @@ -33,7 +34,8 @@
>>>
>>> @my_dt.setter
>>> def my_dt(self, new_dt: datetime):
>>> # A sample `setter` which sets the inverse (roughly) of the `month` and `day`
>>> # A sample `setter` which sets the inverse (roughly) of
>>> # the `month` and `day`
>>> self._my_dt = new_dt.replace(month=13 - new_dt.month,
>>> day=30 - new_dt.day)
>>>
Expand Down Expand Up @@ -64,88 +66,14 @@
For full documentation and more advanced usage, please see
<https://dcw.ritviknag.com>.

:copyright: (c) 2021-2025 by Ritvik Nag.
:copyright: (c) 2021-2026 by Ritvik Nag.
:license: Apache 2.0, see LICENSE for more details.
"""
from logging import NullHandler

__all__ = [
# Base exports
'DataclassWizard',
'JSONSerializable',
'JSONPyWizard',
'JSONWizard',
'register_type',
'LoadMixin',
'DumpMixin',
'property_wizard',
# Wizard Mixins
'EnvWizard',
'JSONListWizard',
'JSONFileWizard',
'TOMLWizard',
'YAMLWizard',
# Helper serializer functions + meta config
'fromlist',
'fromdict',
'asdict',
'LoadMeta',
'DumpMeta',
'EnvMeta',
# Models
'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',
# Logging
'LOG',
]

import logging

from .bases_meta import LoadMeta, DumpMeta, EnvMeta, register_type
from .dumpers import DumpMixin, setup_default_dumper
from .environ.wizard import EnvWizard
from .loader_selection import asdict, fromlist, fromdict
from .loaders import LoadMixin, setup_default_loader
from .log import LOG
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 .property_wizard import property_wizard
from .serial_json import DataclassWizard, JSONWizard, JSONPyWizard, JSONSerializable
from .wizard_mixins import JSONListWizard, JSONFileWizard, TOMLWizard, YAMLWizard

from ._log import LOG
from ._public import *

# Set up logging to ``/dev/null`` like a library is supposed to.
# http://docs.python.org/3.3/howto/logging.html#configuring-logging-for-a-library
LOG.addHandler(logging.NullHandler())

# Setup the default type hooks to use when converting `str` (json) or a Python
# `dict` object to a `dataclass` instance.
setup_default_loader()

# Setup the default type hooks to use when converting `dataclass` instances to
# a JSON `string` or a Python `dict` object.
setup_default_dumper()
LOG.addHandler(NullHandler())
2 changes: 1 addition & 1 deletion dataclass_wizard/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
__author__ = 'Ritvik Nag'
__author_email__ = 'me@ritviknag.com'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2021-2025 Ritvik Nag'
__copyright__ = 'Copyright 2021-2026 Ritvik Nag'
Loading
Loading