Metadata-Version: 2.4
Name: returnz-pydantic
Version: 0.1.0
Summary: Pydantic v2 integration for returnz — tagged-envelope serialization, parse() boundary, tagged errors.
Project-URL: Homepage, https://github.com/tamasbelinszky/returnz
Project-URL: Repository, https://github.com/tamasbelinszky/returnz
Project-URL: Issues, https://github.com/tamasbelinszky/returnz/issues
Author: Tamás Belinszky
License-Expression: MIT
License-File: LICENSE
Keywords: pydantic,result,returnz,serialization,validation
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Pydantic :: 2
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.14
Requires-Dist: pydantic>=2.9
Requires-Dist: returnz>=0.1.0
Description-Content-Type: text/markdown

# returnz-pydantic

Pydantic v2 integration for [`returnz`](https://pypi.org/project/returnz/). Python 3.14+.

- **`RzResult[T, E]` / `RzMaybe[T]`** — use as Pydantic field types. They serialize
  as **tagged envelopes** (`{"ok": …}` / `{"err": …}` / `{"some": …}` /
  `{"nothing": true}`) and reconstruct by tag, so a value survives any boundary
  (JSON, structured clone, RPC). `Some(None)` stays distinct from `Nothing`.
  Keep using plain `Result` / `Maybe` everywhere else — the core stays Pydantic-free.
- **`parse(Model, data)` / `parse_json(Model, data)`** — validation as a boundary:
  `Result[Model, ValidationError]`.
- **`TaggedError`** — base for matchable, serializable typed errors.
