GitXplorerGitXplorer
V

pydantic-devtools

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
3ee8f0516dbafc900ec9e92225630aa06425a416

Update `README.md`

VViicos committed 4 months ago
Unverified
324fbc81169c0778ac7a165a6bd8a0b71c404144

Prepare release `0.2.0`

VViicos committed 4 months ago
Unverified
58b81d9d16287976c1e460eea7538e349ada9b61

Add help to `pc` command

VViicos committed 4 months ago
Unverified
5603dedeadbd70fc951a2bda3c1085e5489e879c

Add a new `pc` command, misc. changes

VViicos committed 4 months ago
Unverified
ba2ea7504161d7581bab05246045e3d689fb128c

Prepare release `0.1.0`

VViicos committed 4 months ago
Unverified
74b0d5ae5ed3ee689f0b5bdfc566ef5514c4777e

Fix CI

VViicos committed 4 months ago

README

The README file for this repository.

pydantic-devtools

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

The Pydantic debugger

pydantic-devtools provides a custom Pdb class, adding various commands.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.

pps command

The pps (pretty-print schema) command can be used to debug Pydantic core schemas:

(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().

pc command

The pc (Pydantic context) command can be used to get information related to the current schema generation process:

pc command example