Skip to main content

Pydantic extraction utilities for valbridge's Zod conversion pipeline

Project description

valbridge-pydantic-extractor

Extract valbridge-compatible schema data from existing Pydantic models for high-fidelity Zod generation.

PyPI License


Installation

pip install valbridge-pydantic-extractor
# or
uv add valbridge-pydantic-extractor

CLI usage

valbridge-pydantic-extractor app.models:User --python-path .

Output is JSON with:

  • schema -- the extracted JSON Schema document
  • diagnostics -- import or extraction diagnostics when the target cannot be resolved cleanly

Options

Flag Description
--python-path <path> Prepend an import path before loading the target module
--module-root <path> Add module roots for project-local imports
--stub-module <module> Install placeholder modules for optional imports
--env KEY=VALUE Inject environment variables before importing the model

Key behaviors

  • Target must use module:Class format
  • Target class must inherit from pydantic.BaseModel
  • Extracted output preserves x-valbridge annotations needed by downstream code generation
  • Emits diagnostics for Pydantic features that cannot be represented in JSON Schema

Related packages

Package Purpose
valbridge-pydantic Pydantic adapter (JSON Schema to Pydantic)
valbridge-core Core IR and JSON Schema parser
@vectorfyco/valbridge-zod-extractor TypeScript equivalent for Zod schemas

Learn more

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

valbridge_pydantic_extractor-1.2.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

valbridge_pydantic_extractor-1.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file valbridge_pydantic_extractor-1.2.0.tar.gz.

File metadata

File hashes

Hashes for valbridge_pydantic_extractor-1.2.0.tar.gz
Algorithm Hash digest
SHA256 583686158956f1b2751865a7ecba1c36eceab6e55b11c49c76b7570a44821ff2
MD5 085d0078c4d76f85545afbea0e2d5327
BLAKE2b-256 eb772cf41688c92770087c05c72c643db69b8e5c168db1a8c46466473eb1bc31

See more details on using hashes here.

Provenance

The following attestation bundles were made for valbridge_pydantic_extractor-1.2.0.tar.gz:

Publisher: release-please.yml on vectorfy-co/valbridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file valbridge_pydantic_extractor-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for valbridge_pydantic_extractor-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dddb0e4f32c3b1a978142606cd06090c27468156a39ccd276da841a1022af7c6
MD5 e58e789eb702048052d4dbf765cdb0c3
BLAKE2b-256 2a35f7977a080f2111257ecd67c10855ff316b65acb29d705caa7318206eb738

See more details on using hashes here.

Provenance

The following attestation bundles were made for valbridge_pydantic_extractor-1.2.0-py3-none-any.whl:

Publisher: release-please.yml on vectorfy-co/valbridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page