pydoc > pydantic_core

📛 NAME

pydantic_core

🚀 Quick Reference

Use CaseCommandDescription
Validate Python dataSchemaValidator(schema).validate_python(data)Validate a Python object against a schema
Validate JSON stringSchemaValidator(schema).validate_json(json_str)Validate a JSON string against a schema
Validate assignmentSchemaValidator(schema).validate_assignment(obj, field, val)Validate a single field assignment
Serialize to JSONSchemaSerializer(schema).to_json(obj)Serialize a Python object to a JSON string
Serialize to PythonSchemaSerializer(schema).to_python(obj)Serialize to Python primitives
Custom errorraise PydanticCustomError('my_error', 'Template {value}', {'value': 123})Raise a custom validation error
Access validation errorsValidationError.errors()Get list of error details
Build a URLUrl.build(scheme='https', host='example.com')Construct a parsed URL
Convert JSONfrom_json(data)Parse JSON into Python with Pydantic core types
Convert to JSONto_json(value)Serialize Python to JSON string with full control

📦 PACKAGE CONTENTS

🧬 CLASSES

💠 ArgsKwargs

class ArgsKwargs(builtins.object)
 |  ArgsKwargs(args, kwargs=None)

Methods defined here:

Static methods defined here:

Data descriptors defined here:

Data and other attributes defined here:

💠 CoreConfig

class CoreConfig(builtins.dict)

Base class for schema configuration options.

Attributes:

Method resolution order:

Data descriptors defined here:

Data and other attributes defined here: __annotations__, __closed__, __extra_items__, __mutable_keys__, __optional_keys__, __orig_bases__, __readonly_keys__, __required_keys__, __total__

Methods inherited from builtins.dict:

Class methods inherited from builtins.dict: __class_getitem__, fromkeys

Static methods inherited: __new__; __hash__ = None

💠 ErrorDetails

class ErrorDetails(builtins.dict)

Method resolution order: ErrorDetailsbuiltins.dictbuiltins.object

Data descriptors: __dict__, __weakref__

Required keys: ctx, input, loc, msg, type, url (all mutable). No optional keys. __total__ = True.

Inherited dict methods: __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __init__, __ior__, __iter__, __le__, __len__, __lt__, __ne__, __or__, __repr__, __reversed__, __ror__, __setitem__, __sizeof__, clear, copy, get, items, keys, pop, popitem, setdefault, update, values; __class_getitem__, fromkeys.

💠 InitErrorDetails

class InitErrorDetails(builtins.dict)

Similar to ErrorDetails but required keys are ctx, input, loc, type (all mutable). __total__ = True.

Inherited dict methods as above.

💠 MultiHostUrl

class MultiHostUrl(builtins.object)
 |  MultiHostUrl(url, *, preserve_empty_path=False)

Methods defined here:

Class methods defined here:

Static methods: __new__

Data descriptors: fragment, path, query, scheme

💠 PydanticCustomError

class PydanticCustomError(builtins.ValueError)
 |  PydanticCustomError(error_type, message_template, context=None, /)

Methods:

Data descriptors: context, message_template, type

Inherited from ValueError: __init__; from BaseException: __delattr__, __getattribute__, __reduce__, __setattr__, __setstate__, with_traceback, args, __cause__, __context__, __dict__, __suppress_context__, __traceback__

💠 PydanticKnownError

class PydanticKnownError(builtins.ValueError)
 |  PydanticKnownError(error_type, context=None, /)

Methods: __repr__, __str__, message()

Data descriptors: context, message_template, type

Inherited as above.

💠 PydanticOmit

class PydanticOmit(builtins.Exception)

Methods: __repr__, __str__; inherited __init__, etc.

💠 PydanticSerializationError

class PydanticSerializationError(builtins.ValueError)
 |  PydanticSerializationError(message, /)

Methods: __repr__, __str__; inherited __init__ and base exception methods.

💠 PydanticSerializationUnexpectedValue

class PydanticSerializationUnexpectedValue(builtins.ValueError)
 |  PydanticSerializationUnexpectedValue(message=None, field_name=None, field_type=None, input_value=None, /)

Methods: __repr__, __str__; inherited as above.

💠 PydanticUndefinedType

class PydanticUndefinedType(builtins.object)

Methods: __copy__, __deepcopy__, __reduce__, __repr__, __new__, new()

💠 PydanticUseDefault

class PydanticUseDefault(builtins.Exception)

Methods: __repr__, __str__; inherited __init__ and base exception methods.

💠 SchemaError

class SchemaError(builtins.Exception)
 |  SchemaError(message)

Methods: __repr__, __str__, error_count(), errors(); inherited base exception methods.

💠 SchemaSerializer

class SchemaSerializer(builtins.object)
 |  SchemaSerializer(schema, config=None, _use_prebuilt=True)

Methods:

Static method: __new__

💠 SchemaValidator

class SchemaValidator(builtins.object)
 |  SchemaValidator(schema, config=None, _use_prebuilt=True)

Methods:

Static method: __new__

Data descriptor: title

💠 Some

class Some(builtins.object)
 |  Some(value)

Methods: __repr__; class method: __class_getitem__; static: __new__; data descriptor: value; __match_args__ = ('value',)

💠 TzInfo

class TzInfo(datetime.tzinfo)
 |  TzInfo(seconds=0.0)

Methods: __deepcopy__, __eq__, __ge__, __gt__, __hash__, __le__, __lt__, __ne__, __reduce__, __repr__, __str__, dst(dt), fromutc(dt), tzname(dt), utcoffset(dt); inherited __getattribute__.

💠 Url

class Url(builtins.object)
 |  Url(url, *, preserve_empty_path=False)

Methods: __bool__, __deepcopy__, __eq__, __ge__, __getnewargs__, __gt__, __hash__, __le__, __lt__, __ne__, __repr__, __str__, query_params(), unicode_host(), unicode_string(); class method: build(*, scheme, host, username=None, password=None, port=None, path=None, query=None, fragment=None); static: __new__; descriptors: fragment, host, password, path, port, query, scheme, username

💠 ValidationError

class ValidationError(builtins.ValueError)
 |  ValidationError(title, line_errors, input_type='python', hide_input=False)

Methods: __reduce__, __repr__, __str__, error_count(), errors(*, include_url=True, include_context=True, include_input=True), json(*, indent=None, include_url=True, include_context=True, include_input=True); class method: from_exception_data(title, line_errors, input_type='python', hide_input=False); static: __new__; descriptor: title. Inherited: __init__, base exception methods.

🔧 FUNCTIONS

📊 DATA

🏷️ VERSION

2.46.4

📁 FILE

/home/chedong/.local/lib/python3.10/site-packages/pydantic_core/__init__.py

pydantic_core
📛 NAME 🚀 Quick Reference 📦 PACKAGE CONTENTS 🧬 CLASSES
💠 ArgsKwargs 💠 CoreConfig 💠 ErrorDetails 💠 InitErrorDetails 💠 MultiHostUrl 💠 PydanticCustomError 💠 PydanticKnownError 💠 PydanticOmit 💠 PydanticSerializationError 💠 PydanticSerializationUnexpectedValue 💠 PydanticUndefinedType 💠 PydanticUseDefault 💠 SchemaError 💠 SchemaSerializer 💠 SchemaValidator 💠 Some 💠 TzInfo 💠 Url 💠 ValidationError
🔧 FUNCTIONS 📊 DATA 🏷️ VERSION 📁 FILE

Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 11:08 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^