Skip to content

Add dataclass_wizard.formats.* functional API (loads/dumps/load/dump) for JSON/YAML/TOML/ENV #230

@rnag

Description

@rnag
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIdocumentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions