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.1.0.tar.gz (8.7 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.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for valbridge_pydantic_extractor-1.1.0.tar.gz
Algorithm Hash digest
SHA256 23d7bc12650c48dddaf9b79f6322cd3a4e6efd151e77e20a244fa8d37fdbe4b9
MD5 fc0d391c7aa83179bb005cca5a34eb95
BLAKE2b-256 a6b85a3270f803734f31dc335eac8e382f68eb99d296c2d93cf666004533c421

See more details on using hashes here.

Provenance

The following attestation bundles were made for valbridge_pydantic_extractor-1.1.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for valbridge_pydantic_extractor-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca8ead414fb83eb35befbdac734ad3d6bdfce62e32131b59b33316b2a617179e
MD5 bfc784a953d6ecdb66c94e974927c642
BLAKE2b-256 b5ff75169cf5c10dec42d08c31e74aa783c83eaeb1d8268f84bb9d863f9114f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for valbridge_pydantic_extractor-1.1.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