Skip to main content

YIDL Dataclass

yidl_dataclass creates Python dataclasses from modular YIDL templates. Ordinary fields use direct writable slots by default. Named factories, conversion, validation, constant and lazy fields add specialized generated methods for the fields that need them.

This package supports CPython 3.12, 3.13, 3.14 and 3.15. Its original supported functional/package implementation and Undoable comparison integration are accepted after both independent final reviews reported GO. Historical benchmarks measured an earlier artifact tuple; corrected final paths have not been timed. No universal speed or memory advantage is claimed.

Install from PyPI:

python -m pip install yidl-dataclass

The locked runtime dependencies are Astichi 1.1.3 and YIDL 0.1.2. Sibling SDK checkouts and SDK rebuilds are unnecessary. The wheel contains this README, public guides and the first-use example under yidl_dataclass/documentation.

from yidl_dataclass import dataclass, field, fields, asdict, replace

@dataclass
class Inventory:
    count: int
    label: str = "stock"
    tags: list = field(default_factory=list, compare=False, repr=False)

item = Inventory(3)
item.count = 4
assert asdict(item) == {"count": 4, "label": "stock", "tags": []}
assert not hasattr(item, "__dict__")
assert replace(item, count=5).count == 5
assert [description.name for description in fields(item)] == ["count", "label", "tags"]

Run examples/first_use.py for the complete introductory example. The API guide covers defaults, field families, factories, pipelines, lazy state, inspection, copying, replacement and supported inheritance. The generation guide explains emitted source, packaging, regeneration and the reusable comparison resource.

The main differences from stdlib dataclasses are slots enabled by default, strict boolean flags, replacement of slotted declarations, no __post_init__, hidden InitVars, field-specific read-only properties, and explicitly excluded writable frozen caches. Several advanced combinations are rejected rather than silently ignored; the API guide lists them. Std Field, MISSING, InitVar, KW_ONLY, inspection and data helpers remain interoperable on the documented subset.

Opt-in freezable=True models can be populated and then permanently frozen using freeze(). Per-field freeze callbacks select the frozen representation and can cascade to child objects. The transition is optimistic: cycles and repeated calls are handled, but failures do not roll back earlier work. See the API guide for field policies, inheritance and shallow-freeze limitations. Frozen hashing still follows the existing dataclass options; freeze-time hash activation is not added. The runtime-freeze extension is an experimental addition beyond the historical review baseline above; its acceptance tests and goldens do not constitute a new independent release review. Run examples/runtime_freeze.py for mutable setup, permanent freezing, typed-child inference and a list-to-tuple field policy.

Development checks use the original SDK wheels: python -m pytest -q and python -m yidl_dataclass.regenerate_dataclass_base. Regeneration checks by default; --write refreshes the base from the packaged authored YIDL resources. python -m hatchling build builds only this consumer. Source compilation/cache reuse during generation is permitted; no parser-free or wholly Rust execution claim is made.

The experiment record preserves the original GO time, scope correction, dependency detour, TDD deviations, independent reviews and actual evidence. The active boundary keeps SDKs/Lifecycle reference-only. The authoritative shared comparison resource is owned here; Undoable consumes it at regeneration time and has no Dataclass runtime dependency. See E/F evidence. The publication record distinguishes the later initial GitHub upload from the completed experiment and its measurements.

Releases use Gearu; see RELEASE.md. Release preparation and current checks are recorded in dev-docs/RELEASE_TODOS.md. GitHub releases run .github/workflows/publish.yml: both backends on all supported Python minors, wheel checks and trusted publishing. The release tag must match the package version, for example v0.1.0.

Metadata

Release files for yidl-dataclass 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yidl-dataclass 0.1.1
File Size Uploaded Provenance Actions
yidl_dataclass-0.1.1.tar.gz 7.6 MB With provenance Details for yidl_dataclass-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yidl-dataclass 0.1.1
File Interpreter ABI Platform Actions
yidl_dataclass-0.1.1-py3-none-any.whl Python 3 none any Details for yidl_dataclass-0.1.1-py3-none-any.whl

Total release size: 7.7 MB

Release files / yidl_dataclass-0.1.1.tar.gz

Download URL yidl_dataclass-0.1.1.tar.gz
Size 7.6 MB
Tags Source
SHA-256 checksum
How to use checksums
66766761a1b7d668c910c12b09fe3b5ed096081cda89e353d993d4f8fdc92d7b
BLAKE2b-256 checksum
How to use checksums
49634bb416dc4f8f602e128badeff8732ebe1a1c4e919dbdf2830ec9aaa071c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / yidl_dataclass-0.1.1-py3-none-any.whl

Download URL yidl_dataclass-0.1.1-py3-none-any.whl
Size 97.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b32a68deb00d3537d8694e05d350b85fb392d2f157326de749fa809526a7984d
BLAKE2b-256 checksum
How to use checksums
39155e93f8cd78c82ca637c8486f7beccfafc600e2d928af367b2fbc05e09ae8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for yidl-dataclass 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for yidl_dataclass-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page