-
Notifications
You must be signed in to change notification settings - Fork 253
/
_pydantic_core.pyi
52 lines (42 loc) · 1.73 KB
/
_pydantic_core.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import sys
from typing import Any, TypedDict
from pydantic_core.core_schema import CoreConfig, CoreSchema
if sys.version_info < (3, 11):
from typing_extensions import NotRequired
else:
from typing import NotRequired
__all__ = '__version__', 'SchemaValidator', 'SchemaError', 'ValidationError', 'PydanticValueError'
__version__: str
build_profile: str
class SchemaValidator:
title: str
def __init__(self, schema: CoreSchema, config: 'CoreConfig | None' = None) -> None: ...
def validate_python(self, input: Any, strict: 'bool | None' = None, context: Any = None) -> Any: ...
def isinstance_python(self, input: Any, strict: 'bool | None' = None, context: Any = None) -> bool: ...
def validate_json(
self, input: 'str | bytes | bytearray', strict: 'bool | None' = None, context: Any = None
) -> Any: ...
def isinstance_json(
self, input: 'str | bytes | bytearray', strict: 'bool | None' = None, context: Any = None
) -> bool: ...
def validate_assignment(
self, field: str, input: Any, data: 'dict[str, Any]', strict: 'bool | None' = None, context: Any = None
) -> 'dict[str, Any]': ...
class SchemaError(Exception):
pass
class ErrorDetails(TypedDict):
kind: str
loc: 'list[int | str]'
message: str
input_value: Any
context: NotRequired['dict[str, Any]']
class ValidationError(ValueError):
title: str
def error_count(self) -> int: ...
def errors(self) -> 'list[ErrorDetails]': ...
class PydanticValueError(ValueError):
kind: str
message_template: str
context: 'dict[str, str | int] | None'
def __init__(self, kind: str, message_template: str, context: 'dict[str, str | int] | None' = None) -> None: ...
def message(self) -> str: ...