Skip to content

parse

FFprobe XML parsing utilities.

Functions:

Name Description
is_dataclass_type

Check if an object is a dataclass type.

parse_ffprobe

Parse ffprobe XML output into ffprobeType dataclass using JSON dict.

is_dataclass_type

is_dataclass_type(obj: type[Any]) -> TypeGuard[type[T]]

Check if an object is a dataclass type.

Parameters:

Name Type Description Default
obj type[Any]

The object to check

required

Returns:

Type Description
TypeGuard[type[T]]

True if the object is a dataclass type, False otherwise

parse_ffprobe

parse_ffprobe(xml_string: str) -> ffprobeType

Parse ffprobe XML output into ffprobeType dataclass using JSON dict.

Parameters:

Name Type Description Default
xml_string str

The XML string to parse

required

Returns:

Type Description
ffprobeType

The parsed ffprobeType instance