MCPcopy
hub / github.com/pydantic/pydantic / parse_file

Method parse_file

pydantic/v1/main.py:575–592  ·  view source on GitHub ↗
(
        cls: Type['Model'],
        path: Union[str, Path],
        *,
        content_type: str = None,
        encoding: str = 'utf8',
        proto: Protocol = None,
        allow_pickle: bool = False,
    )

Source from the content-addressed store, hash-verified

573
574 @classmethod
575 def parse_file(
576 cls: Type['Model'],
577 path: Union[str, Path],
578 *,
579 content_type: str = None,
580 encoding: str = 'utf8',
581 proto: Protocol = None,
582 allow_pickle: bool = False,
583 ) -> 'Model':
584 obj = load_file(
585 path,
586 proto=proto,
587 content_type=content_type,
588 encoding=encoding,
589 allow_pickle=allow_pickle,
590 json_loads=cls.__config__.json_loads,
591 )
592 return cls.parse_obj(obj)
593
594 @classmethod
595 def from_orm(cls: Type['Model'], obj: Any) -> 'Model':

Callers

nothing calls this directly

Calls 2

load_fileFunction · 0.90
parse_objMethod · 0.45

Tested by

no test coverage detected