dataclass-wizard
dataclass-wizard copied to clipboard
Add `dataclass_wizard.formats.*` functional API (loads/dumps/load/dump) for JSON/YAML/TOML/ENV
-
Goal: Provide a non-mixin API for format conversions.
-
Proposed API:
-
dataclass_wizard.formats.json.loads(cls, s, **kw) -> cls -
...json.dumps(obj, **kw) -> str -
...json.load(cls, fp, **kw) -> cls -
...json.dump(obj, fp, **kw) -> None - Same for
yaml,toml,env(dotenv-style) where applicable.
-
-
Acceptance criteria:
- Mixins delegate to format functions (single source of truth).
- Optional deps remain optional (ImportError with clear “install extra” message).
- Docs: add a “Formats API” section with examples.