History¶
0.35.0 (2025-01-19)¶
Features and Improvements
- V1 Opt-In:
- Add support for Patterned Date and Time:
Naive Date/Time/Datetime
Timezone-aware Time/Datetime
UTC Time/Datetime
Update
Alias()andAliasPath()to support multiple aliases and nested path(s)Update the
KeyCase.AUTOsetting (specified viav1_key_case='AUTO') to correctly handle multiple possible keys for the field (e.g., it doesn’t latch onto the first encountered key but now tries all valid key case transformations at runtime). This now results in expected or desired behavior (fixes #175)Float to Int Conversion Change: In V1 Opt-in (via
Metasettingv1=True), floats or float strings with fractional parts (e.g.,123.4or"123.4") are no longer silently converted to integers. Instead, they now raise an error. However, floats without fractional parts (e.g.,3.0or"3.0") will continue to convert to integers as before.- Add documentation:
Patterned Date and Time
Aliases
Add tests for coverage
Optimize logic for determining if an annotated type is a
TypedDictUpdate
requirements-bench.txtto correctly capture all Benchmark-related dependencies
Bugfixes
Ensure the
py.typedmarker is included in the source distribution (fixes #173)Address a minor bug in object path parsing that did not correctly interpret quoted literal values within blocks such as braces
[]
0.34.0 (2024-12-30)¶
Features and Improvements
- V1 Opt-in
- Support for recursive types OOTB for the following Python types:
NamedTupleTypedDictUnionLiteralNested dataclasses
Type aliases (introduced in Python 3.12+)
Full support for
bytesandbytearrayin the de/serialization process (fixes #140).Performance improvements: Optimized Load functions for
bool,NamedTuple,datetime,date, andtime.Added support for Type aliases (via
typestatement in Python 3.12+).Improved logic in
load_to_strto better check if it’s within anOptional[...]type.Enhanced handling of sub-types in de/serialization (TODO: add test cases).
Show deprecation warning for Meta setting
debug_enabled(replaced byv1_debug).
Updated benchmarks for improved accuracy.
Bugfixes
Fixed issue where code generation failed to correctly account for indexes, especially when nested collection types like
dictwere used within aNamedTuple.make checknow works out-of-the-box for validatingREADME.rstand other RST files for PyPI deployment.#169: Explicitly added
utf-8encoding forsetup.pyto enable installation from source on Windows (shoutout to @birkholz-cubert!).
0.33.0 (2024-12-17)¶
Introduce
v1opt-in, providing a more user-friendly experience with significant performance improvements for de-serialization 🎉- Add models for
v1, imported fromdataclass_wizard.v1: Alias()AliasPath()
- Add models for
- Add enums for
v1, imported fromdataclass_wizard.v1.enums: KeyCaseKeyAction
- Add enums for
- Add
Metasettings forv1: v1— Enable opt-in for the “experimental” major release v1 feature.v1_debug— Replaces the deprecateddebug_enabledMeta setting, which will be removed inv1.v1_key_case— Specifies the letter case used for matching JSON keys when mapping them to dataclass fields.v1_field_to_alias— Custom mapping of dataclass fields to their JSON aliases (keys) for de/serialization.v1_on_unknown_key— Defines the action to take when an unknown JSON key is encountered duringfrom_dict()orfrom_json()calls.v1_unsafe_parse_dataclass_in_union— Unsafe option: Enables parsing of dataclasses in unions without requiring the presence of atag_key.
- Add
Require the
typing-extensionslibrary up to Python 3.11 (its main use in Python 3.11 isReadOnlyforTypedDict).Phase out the
UnknownJSONKeyexception class in favor ofUnknownKeysError, sincev1now provides all missing keys in JSON (not just the first one!).- Update benchmarks:
Add benchmark for
CatchAll.Move benchmark dependencies to
requirements-bench.txt.
Add new test cases.
0.32.1 (2024-12-04)¶
Bugfixes
Corrected logic in
MappingParserthat assumed all parsers were subclasses ofAbstractParser(#159).Add test case to confirm intended functionality.
Bump dev dependencies to latest version.
0.32.0 (2024-11-30)¶
Features and Improvements
- Add support for ABC Containers in
typingandcollections.abc: CollectionSequenceMutableSequence
- Add support for ABC Containers in
Bugfixes
Fixed a bug in
ParseErrorhandling.Resolved an issue in
EnvWizardwhere passing an instance of a dataclass field type to the constructor caused problems.Corrected logic in
parsers.pythat assumed all parsers were subclasses ofAbstractParser; parsers can now be functions as well.
0.31.0 (2024-11-30)¶
Happy Thanksgiving 🦃, y’all! In this release, Dataclass Wizard introduces the long-awaited EnvWizard 😳🎉.
Features and Improvements
EnvWizard:Support for working with environment variables, secret files, and .env files.
- New Functions and Helpers:
EnvMeta(): Helper function to set up theMetaConfig forEnvWizard.env_field(): Alias fordataclasses.Field()to set a custom environment variable for a field.- Helper Functions:
as_bool(),as_int(),as_str()optimized.as_list(),as_dict()added.
- Meta Class Enhancements:
New meta classes such as
AbstractEnvMeta.- New fields added to the
Metaclass: env_var_to_fieldfield_to_env_vardebug_enabledrecursiveenv_fileenv_prefixsecrets_dirkey_lookup_with_loadkey_transform_with_dumpskip_defaultsskip_ifskip_defaults_if
- New fields added to the
- Benchmark Updates:
Updated benchmarks to include new libraries.
Added the
--all | -Aoption to benchmark tests for running longer tests against some libraries.
- Documentation:
General documentation updates.
0.30.1 (2024-11-25)¶
Bugfixes
Resolved inconsistent behavior with dataclasses in
UnionwhenMetatag_keyis also defined as a dataclass field (#148).
0.30.0 (2024-11-25)¶
Features and Improvements
- Conditional Field Skipping: Omit fields during JSON serialization based on user-defined conditions.
- Introduced new
Metasettings: skip_if— Skips all fields matching a condition.skip_defaults_if— Skips fields with default values matching a condition.
- Introduced new
Added per-field controls using
SkipIf()annotations.Introduced the
skip_if_field()wrapper for maximum flexibility.
- New Helper Class:
JSONPyWizard A
JSONWizardhelper to disable camelCase transformation and keep keys as-is.
- New Helper Class:
Typing Improvements: Added more
*.pyifiles for enhanced type checking and IDE support.- Documentation Updates:
Added details about upcoming changes in the next major release,
v1.0.
0.29.3 (2024-11-24)¶
Bugfixes
Fixed compatibility between Global Meta Settings and
recursive_classes(#142).
0.29.2 (2024-11-24)¶
Bugfixes
Fixed issue with using
Meta.auto_assign_tagsandMeta.raise_on_unknown_json_keytogether (#137).Fixed
JSONWizard.debugto prevent overwriting existing class meta.Resolved issue where both
auto_assign_tagsandCatchAllresulted in the tag key being incorrectly saved inCatchAll.Fixed issue when
CatchAllfield was specified with a default value but serialized withskip_defaults=False.Improved performance in
UnionParser: ensured thatget_parser()is called only once per annotated type.Added test case(s) to confirm intended behavior.
0.29.1 (2024-11-23)¶
Bugfixes
Include
*.pyifiles in source distribution (packaging).
0.29.0 (2024-11-23)¶
Features and Improvements
Nested JSON Mapping (#60): Map nested JSON keys to dataclass fields using helper functions
KeyPath()orjson_field().Catch-All Keys (#57): Save unknown JSON keys with ease.
Cleaner Codebase: Remove comments and type annotations for Python files with
.pyicounterparts.Enhanced Debugging:
debug_enablednow supportsbool | int | str, allowing flexible logging levels.Documentation Updates: Improved and expanded docs!
0.28.0 (2024-11-15)¶
Features and Improvements
Added
TOMLWizard.- Introduced new (pre-process) serializer hooks:
_pre_from_dict()_pre_dict()
Added
debugparameter toJSONWizard.__init_subclass__().- Added
*.pyistub files for better Type Hinting and Autocompletion in IDEs (e.g., PyCharm): abstractions.pyiserial_json.pyi
- Added
Introduced utility class
FunctionBuilderto help build and dynamicallyexeca function.Documentation/tests on the new and updated features.
Changes
The returned parser for a dataclass is now the original load/dump function itself (which takes a single argument) rather than a
Parserinstance.Minor optimization and quality-of-life improvement: dynamically
execdataclass load and dump functions.Improved performance: if a class defines a
from_dict()method - equivalent tofromdict()- and ato_dict()method - equivalent toasdict()- replace them with dynamically generated load/dump functions.Deprecated the pre-process hook
DumpMixin.__pre_as_dict__().
0.27.0 (2024-11-10)¶
Features and Improvements
- This minor release drops support for Python 3.6, 3.7, and 3.8, all of which have reached End of Life (EOL). Check out the Python End of Life Cycle here. Key changes resulting from this update include:
Resolved pyup errors, previously flagged as “insecure” due to outdated package versions that lacked support for Python 3.8 or earlier.
Update all requirements to latest versions.
Cleaned up various TODO comments scattered throughout the codebase, as many were specific to older Python versions.
Simplified and improved codebase for easier maintenance.
Remove everything except the
py.typedfile (see comment).
Added support for cyclic or “recursive” dataclasses, as first mentioned in #62 (special thanks to @dlenski for finalizing this in #138!).
Bugfixes
#62: Cyclic or “recursive” dataclasses no longer raises a
RecursionError.Typing locals should now correctly key off the correct Python version, see the commit that addressed this.
0.26.1 (2024-11-09)¶
0.26.0 (2024-11-05)¶
This will be the latest (minor) release with support for Python 3.6, 3.7, and 3.8 – all of which have reached end-of-life!
Features and Improvements
Bugfixes
Fix:
LiteralParser.__contains__()method compares value of item with Literal arguments. Contributed by @mikeweltevrede in #111.
0.25.0 (2024-11-03)¶
Features and Improvements
Add support for pathlib.Path. Thanks to @assafge in #79.
0.24.1 (2024-11-03)¶
0.24.0 (2024-11-03)¶
Features and Improvements
#125: add support for
typing.Required,NotRequired
Bugfixes
0.23.0 (2024-09-18)¶
0.22.3 (2024-01-29)¶
Features and Improvements
Add full support for Python 3.11 and 3.12 (Credits to @alexanderilyin on #101)
- Project-specific development changes
Update CI to run tests on PY 3.11 and 3.12
Update
wheelversionUpdate
setup.pyto add adevextra which installs dev-related dependenciesMove test dependencies into
requirements-test.txtAdd
sphinx_issuesdependency to easily add link in docs to an user/issue/PR on GitHubUpdate
project_urlson PyPI to add extra links, such as “Changelog” and “Issue Tracker”
Bugfixes
Fix: Loading a Variadic Tuple fails for length 0 (Credits to @intentionally-left-nil on #105)
Stop-gap fix for time-string patterns that contain
-or+, as Python 3.11+ can interpret this as timezone data.
0.22.2 (2022-10-11)¶
Features and Improvements
Minor performance improvement when dumping custom sub-types or unhandled types, such that we cache the dump hook for the type so that subsequent lookups are faster overall.
0.22.1 (2022-05-11)¶
Features and Improvements
Update
MissingFieldsto provide a more user-friendly error message, in cases where a missing dataclass field is not snake-cased, but could - with the right key transform - map to a key in the JSON object. For example, a JSON key ofmyFieldand a field namedMyField.
Bugfixes
Fixed a bug in the load (or de-serialization) process with
from_dict, where aMissingFieldswas raised in cases where a dataclass field is not snake-cased, but is otherwise identical to a key in the JSON object. For example, a JSON key and field both namedviewMode. The JSON data in such cases should now be correctly de-serialized to a dataclass instance as expected.
0.22.0 (2022-02-02)¶
Features and Improvements
Ensure that the
debug_enabledflag now applies recursively to all nested dataclasses, which is more helpful for debugging purposes.Add new attribute
json_object– which contains the original JSON object – toParseErrorobjects, and include it in the object representation.
Bugfixes
Fixed an issue with the
debug_enabledflag enabled, where some load hooks were not properly decorated when debug mode was enabled; errors were not properly formatted in these cases. To elaborate, this only affected load hooks decorated with a@_single_arg_alias. In particular, this affected the load hooks for a few annotated types, such asfloatandenum.
0.21.0 (2022-01-23)¶
Features and Improvements
Adds few extra Wizard Mixin classes that might prove incredibly convenient to use.
JSONListWizard- ExtendsJSONWizardto return Container – instead of list – objects where possible.JSONFileWizard- Makes it easier to convert dataclass instances from/to JSON files on a local drive.YAMLWizard- Provides support to convert dataclass instances to/from YAML, using the default PyYAML parser.
Add a new
Containermodel class, a list sub-type which acts as a convenience wrapper around a collection of dataclass instances.The
dataclass-wizardlibrary now supports parsing of YAML data. It adds the PyYAML as an optional dependency, which is loaded when it’s used for the initial time. This extra dependency can be installed via:$ pip install dataclass-wizard[yaml]
0.20.3 (2021-11-30)¶
Update the parsing logic in
as_timedelta()fortimedeltaannotated types so we now explicitly check the types. If the value is numeric, or if it’s a string in a numeric value like “1.2”, we can parse it directly and so avoid calling thepytimeparsemodule.
0.20.1 - 0.20.2 (2021-11-27)¶
Update and refactor docs, doc layout, and the readme.
Move benchmark tests to the
benchmarks/directory.
0.20.0 (2021-11-23)¶
Support custom patterns for dates and times, which are parsed (de-serialized) using
datetime.strptime(). This allows two approaches to be used, which have complete support in Python 3.7+ currently:Using the
DatePattern,TimePattern, andDateTimePatterntype annotations, representing patterned date, time, and datetime objects respectively.Use
Annotatedto annotate the field aslist[time]for example, and pass inPattern()as an extra.
0.19.0 (2021-11-17)¶
Features and Improvements
Add the option to customize the name of the tag key that will be used to (de)serialize fields that contain dataclasses within
Uniontypes. A new attributetag_keyin theMetaconfig determines the key in the JSON object that will be used for this purpose, which defaults to__tag__if not specified.Add the ability to auto-generate tags for a class - using the name of the class - if a value for
tagis not specified in theMetaconfig for a dataclass that appears within aUniondeclaration. A new flagauto_assign_tagsin theMetaconfig can be enabled to allow auto-assigning the class name as a tag.
0.18.0 (2021-11-14)¶
Breaking Changes
The
LoadMeta()andDumpMeta()helper functions no longer accept a class type as the first argument; the correct usage now is to invoke thebind_to()method on theMetaconfig returned. That is, given a dataclassA, replace the following syntax:LoadMeta(A, **kwargs)
with a more explicit binding:
LoadMeta(**kwargs).bind_to(A)
The
asdict()helper function no longer accepts aMetaconfig as an argument. This is to encourage the usage ofLoadMeta()andDumpMeta(), as mentioned above. The main impetus for this change is performance, since theMetaconfig for a class only needs to be set up once using this approach.Updated the project status from Beta to Production/Stable, to signify that any further breaking changes will result in bumping the major version.
Features and Improvements
Add the
bind_to()method to the base Meta class,BaseJSONWizardMeta.Meta config specified for a main dataclass (i.e. the class passed in to
from_dictandto_dict) now applies recursively to any nested dataclasses by default. The Meta config from the main class will be merged with the Meta config for each nested class. Note that this behavior can be disabled however, with therecursiveparameter passed in to theMetaconfig.Rename
BaseMetatoAbstractMeta, as the name should be overall more clearer, since it’s actually an abstract class.
0.17.1 (2021-11-04)¶
property_wizard: Update the metaclass to support new-style annotations, also via a__future__import declared at a the top of a module; this allows PEP 585 and PEP 604 style annotations to be used in Python 3.7 and higher.
0.17.0 (2021-10-28)¶
Support new-style annotations in Python 3.7+, via a
__future__import declared at a the top of a module; this allows PEP 585 and PEP 604 style annotations to be used in Python 3.7 and higher.wizCLI: Add the -x / –experimental flag, which instead uses new-style annotations in the generated Python code.Update the docs and readme with examples and usage of future annotations in Python 3.7+.
0.16.2 (2021-10-26)¶
Minor code refactor and cleanup to support
ForwardRefin Python 3.6 a little better.
0.16.1 (2021-10-21)¶
Add full support for Python 3.10
0.16.0 (2021-10-20)¶
Add support for serializing
datetime.timedeltaRequires an extra for de-serialization, can be installed via
pip install dataclass-wizard[timedelta].
0.15.2 (2021-10-03)¶
Features and Improvements
Add new internal helper function
eval_forward_ref_if_needed()
Bugfixes
Support forward references in type arguments to
Union, as well as when iterating over the list ofdataclasses.fields()for each data class.
0.15.1 (2021-09-30)¶
Add a new method
list_to_json()to theJSONWizardMixin class, which can be used to convert a list of dataclass instances to a JSON string representation.Minor code refactoring to introduce small typing-related changes.
Update docs.
0.15.0 (2021-09-30)¶
Add the ability to skip fields with default values in the serialization process. A new attribute
skip_defaultsin the innerMetaclass determines whether to skip / omit fields with default values, based on thedefaultordefault_factoryargument todataclasses.field().Add the ability to omit fields in the serialization process.
A new argument
dumpadded to thejson_key()andjson_field()helper functions determines whether to exclude the field in the JSON or dictionary result.The
asdict()helper function has similarly been updated to accept aexcludeargument, containing a list of one or more dataclass field names to exclude from the serialization process.
0.14.2 (2021-09-28)¶
Bugfixes
Dataclass fields that are excluded from the constructor method - i.e. ones defined like
field(init=False...)- should now be similarly handled in the de-serialization process.
0.14.1 (2021-09-26)¶
Bugfixes
The
Meta.tagfield should be updated to aClassVarto help reduce the memory footprint.
0.14.0 (2021-09-25)¶
Features and Improvements
Add the ability to handle de-serialization and serialization of dataclasses within
Uniontypes. A new attributetagin the innerMetaclass determines the tag name to map to a dataclass, when the dataclass is part of anyUniontypes.The dump (serialization) process has been reworked to function more like the load process. That is, it will properly use the
Metaconfig for a dataclass, as well as any custom load hooks for nested dataclasses. Performance or functionality should not otherwise be affected.
0.13.1 (2021-09-24)¶
Bugfixes
Ensure that
setup_dump_config_for_cls_if_needed()is called for nested dataclasses, so that custom key mappings for example can be properly applied.
0.13.0 (2021-09-08)¶
Features and Improvements
Add new error class
MissingData, which is raised when a dataclass field annotated as a data class type has anullJSON value in the load process.Update the
as_int()helper function so thatfloatvalues as well as ones encoded as strings are correctly converted to annotatedinttypes, i.e. using theint(round(float))syntax.Add
EncoderandDecodermodel classes, and properly implement them in theJSONWizardhelper methods.Decorate the
JSONWizardhelper methodsfrom_list(),from_dict(), andto_dict()with the_aliasdecorator.
Bugfixes
property_wizard: Remove the internal usage ofget_type_hints_with_extras()for resolving class annotations. This is becausetyping.get_type_hintswill raise an error if a class has forward references in any type annotations. Since the usage is as a metaclass, forward refs can never be resolved. So we will instead access the class__annotationsdirectly, and for now will ignore any forward references which are declared.Ensure
fromlist()is actually exported at the top level (looks like that was not the case)
0.12.0 (2021-09-06)¶
Change the order of arguments for
fromdict()andfromlist()functions, since it’s more intuitive to pass the name of the data class as the first argument.Add
fromlist(),fromdict(), andasdict()to the public API, and ensure that we export these helper functions.Add new helper functions
LoadMeta()andDumpMeta()to specify the meta config for a dataclass, which can be used with the new functions likefromdictabove.Custom key mappings: support a use case where we want to specify a new mapping via the
__remapping__key in themetadataargument todataclasses.field().
0.11.0 (2021-09-04)¶
Add the ability to handle unknown or extraneous JSON keys in the load (de-serialization) process. A new attribute
raise_on_unknown_json_keyto theMetaclass determines if we should raise an error in such cases.Move attribute definition for the
JSONWizard.Metaclass into a newBaseMetadefinition, 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,
JSONWizardError.Add new error classes
MissingFields- raised when JSON object is missing a required dataclass field.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
load_to_named_tuple_untyped()is used for thecollections.namedtuplevariant.Minor performance improvements so the JSON load process is slightly faster.
0.10.2 (2021-08-29)¶
Rename some internal functions, such as the
default_funcdecorator (renamed to_alias). I felt that this name was overall more clearer.Similarly rename
PassThroughParsertoSingleArgParser, as that’s a bit more clear which types it handles.wizCLI: comment out the –verbose and –quiet flags, as those were unused anyway.Update docs/
0.10.0 (2021-08-28)¶
Minor performance improvements so the JSON load process is slightly faster.
wiz gs: The result now includes theJSONWizardimport 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
strandint, 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 aParserobject incurs a bit of an unnecessary overhead.
0.9.0 (2021-08-23)¶
Features and Improvements
Minor performance improvements so the JSON load process is slightly faster.
Replace
CaseInsensitiveDictwith a customDictWithLowerStoreimplementation.wizCLI: Add a--versionoption to check the installed version.Remove
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 (2021-08-22)¶
Bugfixes
wiz gs: Empty lists should appear asListinstead ofDict
0.8.1 (2021-08-22)¶
Bugfixes
Fix an import issue with the
wizCLI tool.
0.8.0 (2021-08-22)¶
Features and Improvements
Add new
wizcompanion CLI utilityAdd a CLI sub-command
gsto generate the dataclass schema for a JSON file or string input.
Bugfixes
The key transform functions now correctly work when the JSON keys contain spaces. For example, a field named “the number 42” should now be correctly parsed as
the_number_42when the key transformer isto_snake_case().
0.7.0 (2021-08-19)¶
Support the
dequetype in the JSON load and dump process, as well as its equivalent in thetypingmodule.Add
__slots__where possible to classes, to help reduce the overall memory footprint.Slightly changed the order of constructor arguments to most
Parserimplementations.Rename the
type_checkutils module totyping_compat, as I think this name makes it clearer as to its purpose.Rename a few internal functions, such as
BaseJSONWizardMeta._safe_as_enum->BaseJSONWizardMeta._as_enum_safeAdd benchmark tests against a few other libraries
0.6.0 (2021-08-16)¶
Support
setandfrozensettypes in the JSON load and dump process, as well as their equivalents in thetypingmodule.Support custom JSON key mappings for dataclass fields.
- Add new exported helper functions:
json_field: This can be thought of as an alias todataclasses.field(...), but one which also represents a mapping of one or more JSON key names to a dataclass field.json_key: Represents a mapping of one or more JSON key names for a dataclass field.
Add an optional attribute
json_key_to_fieldtoJSONSerializable.MetaRename
ListParsertoIterableParser, since this parser will also be used for Set types.Update the
__call__method of the defaultParserto raise aParseError, so we can provide a more helpful error message when an unknown or unsupported type annotation is encountered.
0.5.1 (2021-08-13)¶
Bugfixes
The
property_wizardmetaclass should now correctly handle cases when field properties are annotated as a standard mutable type (list,dict, orset).The
property_wizardmetaclass should now also honor thedefault_factoryargument to a dataclass field object as expected.Resolved an issue where in some cases the JSON load/dump process failed when Python 3.8+ users imported
TypedDictfromtypinginstead of thetyping_extensionsmodule. Now it should correctly work regardless of which version ofTypedDictis used. This is especially important because of an issue with TypedDict that is present in Python 3.8.
0.5.0 (2021-08-12)¶
Features and Improvements
JSONSerializablenow supports dataclass fields with an Annotated type.The
property_wizardmetaclass has been (similarly) updated to support Annotated field properties; such types can be resolved by making a call totyping.get_type_hintswith the argumentinclude_extras=True.Support for adding global JSON load/dump settings, e.g. when
JSONSerializable.Metais defined as an outer class.Add proper source attributions, and apply the LICENSE and any NOTICE (if applicable) from the sources.
Update comments in code to clarify or elaborate where needed.
Update Sphinx docs/
Bugfixes
When
JSONSerializable.Metais defined as an inner class - which is the most common scenario - it should now be correctly applied per-class, rather than mutating the load/dump process for other dataclasses that don’t define their own innerMetaclass.When logging a message if a JSON key is missing from a dataclass schema, the dataclass name is now also included in the message.
0.4.1 (2021-08-09)¶
Update README docs with usage of newly supported features
0.4.0 (2021-08-09)¶
Features and Improvements
- Add support for serializing the following Python types:
defaultdict(via thetyping.DefaultDictannotation)UUID’sThe special variadic form of
Tuple. For example,Tuple[str, ...].A special case where optional type arguments are passed to
Tuple. For example,Tuple[str, Optional[int], Union[bool, str, None]]
Add new
LetterCase.LISPEnum member, which references theto_lisp_casehelper functionAll the
Enum-subclass attributes inJSONSerializable.Metanow additionally support strings as values; they will be parsed using the Enumnamefield by default, and should format helpful messages on any lookup errors.Remove the
LoadMixin.load_with_objectmethod, as that was already deprecated and slated to be removed.
Bugfixes
Update the
get_class_namehelper function to handle the edge case when classes are defined within a function.Update a few
load_to...methods as astaticmethod
0.3.0 (2021-08-05)¶
Some minor code refactoring
Require
typing-extensionslibrary up till Python 3.9 now (it’s main use for Python 3.8 and 3.9 is the updatedget_originandget_argshelper functions)The default
__str__method is now optional, and can be skipped via the flagstr=FalseAdd some more test cases
0.2.4 (2021-08-04)¶
Update README docs
Move the section on Advanced Usage to the main docs
Cleanup usage and docs in the Field Properties section
0.2.3 (2021-08-03)¶
Add better keywords for the package
0.2.2 (2021-08-03)¶
Explicitly add a dependency on
typing-extensionsfor Python 3.6 and 3.7
0.2.1 (2021-08-03)¶
Fix a bug for Python 3.6 where the build failed when using the PyForwardRef annotation.
0.2.0 (2021-08-03)¶
Rename type variable
EXPLICIT_NULLtoExplicitNullRename module
type_defs.pytotype_def.pyRename module
base_meta.pytobases_meta.pyJSONSerializable.Meta: rename attributedate_time_with_dumptomarshal_date_time_as, as I believe this name is overall more clearer.Refactor the
property_wizardhelper function and update it to cover some edges cases.Add test cases to confirm intended functionality of
property_wizard.
0.1.0 (2021-08-02)¶
First release on PyPI.