Skip to main content

Devtools for the Pydantic library

Project description

pydantic-devtools

A collection of utilities to facilitate debugging of Pydantic's internals.

The Pydantic debugger

pydantic-devtools provides a custom Pdb class, adding a pps (pretty-print schema) command to debug Pydantic core schemas.

To use the Pydantic debugger:

  • set the PYTHONBREAKPOINT environment variable to pydantic_devtools.pdb.
  • In your code, add a breakpoint() call. The Pydantic debugger will be used:
(Pydantic pdb) pps schema
{
    'type': 'model-field',
    'schema': {'type': 'definition-ref', 'schema_ref': '...'},
    'metadata': {'<stripped>'}
}

By default, generic metadata (related to JSON Schema generation) is stripped.

Optionally, a max_depth argument can be provided (pps <schema> <depth>). A default value can also be specified as a keyword argument to breakpoint().

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

pydantic_devtools-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

pydantic_devtools-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file pydantic_devtools-0.1.0.tar.gz.

File metadata

  • Download URL: pydantic_devtools-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.1 CPython/3.12.3 Linux/6.8.0-41-generic

File hashes

Hashes for pydantic_devtools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 64362bfec04c6c9352330f6244141030158623df2c2407e450cd1766a00ce899
MD5 9adace41c146b10417fa1f06e1b45f45
BLAKE2b-256 35bd2ee779a47833ec023eed38f762ff85a381c67bcd79643d1e0684265596e8

See more details on using hashes here.

File details

Details for the file pydantic_devtools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pydantic_devtools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.1 CPython/3.12.3 Linux/6.8.0-41-generic

File hashes

Hashes for pydantic_devtools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac5edee00b1c31cf6bb5680addf295ed86d2150766df8e2b413f4cee440951d2
MD5 0347ad5df1a63d4453eef3ee5ab0e02d
BLAKE2b-256 18c73786b778c5d358f32ec7d858366f8e06a758e21a339f060ad22372d96e84

See more details on using hashes here.

Supported by

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