Skip to main content

server-decorator-gen-pydantic (Python)

Compiles the language-neutral EntitySpec IR (emitted by server-decorator-entity's @restful decorator) into pydantic v2 create / update / read / action-input DTO models — the polyglot sibling of @montionugera/entity-spec-gen-zod, sharing the wire-format contracts in ../../../contracts.

Usage

from server_decorator_entity import entity_spec
from server_decorator_entity.testing.user_fixture import UserFixture
from server_decorator_gen_pydantic import create_model_for, validation_error_fields
import pydantic

spec = entity_spec(UserFixture)
Create = create_model_for(spec)

try:
    Create.model_validate({"email": "not-an-email", "name": "M", "status": "inactive", "tags": []})
except pydantic.ValidationError as exc:
    validation_error_fields(exc)  # -> ["email", "name"]

DTO rules (parity with gen-zod)

  • create_model_for — excludes readonly fields. extra="forbid".
  • update_model_for — same field set as create, all made optional (partial update); a field's own nullable flag is unchanged, so a key may be absent but an explicitly-provided null is only accepted when the field is nullable.
  • read_model_for — excludes writeonly fields.
  • action_input_model_for(spec, name) — the named action's input fields, all required unless marked optional in the IR.
  • Nested obj/list fields thread the same DTO include predicate recursively, so a readonly/writeonly nested field is excluded from the DTOs that shouldn't see it (and extra="forbid" then rejects it as an unknown key if present).

datetime fields

The IR's datetime type requires an explicit UTC offset on the wire (multi-replica decision) — modeled with pydantic.AwareDatetime. A naive ISO-8601 string (no offset) is rejected.

Metadata

Release files for server-decorator-gen-pydantic 2.0.29

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

Source distribution (sdist)

Source distribution for server-decorator-gen-pydantic 2.0.29
File Size Uploaded Provenance Actions
server_decorator_gen_pydantic-2.0.29.tar.gz 10.5 kB With provenance Details for server_decorator_gen_pydantic-2.0.29.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for server-decorator-gen-pydantic 2.0.29
File Interpreter ABI Platform Actions
server_decorator_gen_pydantic-2.0.29-py3-none-any.whl Python 3 none any Details for server_decorator_gen_pydantic-2.0.29-py3-none-any.whl

Total release size: 17.6 kB

Release files / server_decorator_gen_pydantic-2.0.29.tar.gz

Download URL server_decorator_gen_pydantic-2.0.29.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f6b182c4e32240dd3bdf1a3fd5aafa23ea33b52294f656ca33f1b0d0c7041fed
BLAKE2b-256 checksum
How to use checksums
7a9d0fa0a6201dc5c31347d03e504409a1968894eff7a411dbb85edb54f2dd11
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 Nov 15, 2026.

Transparency log

Release files / server_decorator_gen_pydantic-2.0.29-py3-none-any.whl

Download URL server_decorator_gen_pydantic-2.0.29-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a761b7c12a57daee64c3d00975cf8e6a8d79f2c62e0f18d7120290a153c8521
BLAKE2b-256 checksum
How to use checksums
44d48c9936698a1d1ecb97d9dad46b4924b5bb74ffe7dcff8310656c0a98868e
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 Nov 15, 2026.

Transparency log

Security for server-decorator-gen-pydantic 2.0.29

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 server_decorator_gen_pydantic-2.0.29.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 Nov 15, 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