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 topydantic_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64362bfec04c6c9352330f6244141030158623df2c2407e450cd1766a00ce899 |
|
MD5 | 9adace41c146b10417fa1f06e1b45f45 |
|
BLAKE2b-256 | 35bd2ee779a47833ec023eed38f762ff85a381c67bcd79643d1e0684265596e8 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac5edee00b1c31cf6bb5680addf295ed86d2150766df8e2b413f4cee440951d2 |
|
MD5 | 0347ad5df1a63d4453eef3ee5ab0e02d |
|
BLAKE2b-256 | 18c73786b778c5d358f32ec7d858366f8e06a758e21a339f060ad22372d96e84 |