Verifications¶
- param file_path:
The path to the file that needs to be checked.
- type file_path:
str, os.PathLike
- returns:
The resolved and expanded file path if it exists.
- rtype:
str
- raises TypeError:
If the provided file path is not of type str.
- raises FileNotFoundError:
If the file path does not exist.
- pymkv.checking_file_path(file_path: str | PathLike[Any] | None) str ¶
- Parameters:
file_path (str, os.PathLike) – The path to the file that needs to be checked.
- Returns:
The resolved and expanded file path if it exists.
- Return type:
str
- Raises:
TypeError – If the provided file path is not of type str.
FileNotFoundError – If the file path does not exist.
- param file_path:
The path to the Matroska file to be verified.
- type file_path:
str or os.PathLike
- param mkvmerge_path:
The path to the mkvmerge executable. Default is “mkvmerge”.
- type mkvmerge_path:
str, optional
- returns:
True if the Matroska file is valid and is of type “Matroska”, False otherwise.
- rtype:
bool
- raises FileNotFoundError:
If mkvmerge executable is not found at the specified path.
- raises TypeError:
If file_path is not a string or an instance of os.PathLike.
- raises FileNotFoundError:
If the specified file_path does not exist.
- raises ValueError:
If the file_path could not be opened using mkvmerge.
Notes
This method verifies the validity of a Matroska file by checking if it is of type “Matroska” using the mkvmerge command-line tool.
- pymkv.verify_matroska(file_path: str | PathLike[Any], mkvmerge_path: str | PathLike | Iterable[str] = 'mkvmerge') bool ¶
- Parameters:
file_path (str or os.PathLike) – The path to the Matroska file to be verified.
mkvmerge_path (str, optional) – The path to the mkvmerge executable. Default is “mkvmerge”.
- Returns:
True if the Matroska file is valid and is of type “Matroska”, False otherwise.
- Return type:
bool
- Raises:
FileNotFoundError – If mkvmerge executable is not found at the specified path.
TypeError – If file_path is not a string or an instance of os.PathLike.
FileNotFoundError – If the specified file_path does not exist.
ValueError – If the file_path could not be opened using mkvmerge.
Notes
This method verifies the validity of a Matroska file by checking if it is of type “Matroska” using the mkvmerge command-line tool.
- param mkvmerge_path:
The path to the mkvmerge executable. If not provided, the default value is “mkvmerge”.
- type mkvmerge_path:
str | None, optional
- returns:
True, if mkvmerge_path is valid and the mkvmerge executable is found. False otherwise.
- rtype:
bool
- pymkv.verify_mkvmerge(mkvmerge_path: str | PathLike | Iterable[str] = 'mkvmerge') bool ¶
- Parameters:
mkvmerge_path (str | None, optional) – The path to the mkvmerge executable. If not provided, the default value is “mkvmerge”.
- Returns:
True, if mkvmerge_path is valid and the mkvmerge executable is found. False otherwise.
- Return type:
bool
- param file_path:
The path to the file that will be verified.
- type file_path:
Union[str, os.PathLike]
- param mkvmerge_path:
The path to the mkvmerge executable. Default is “mkvmerge”.
- type mkvmerge_path:
str, optional
- returns:
True if the container format of the file is recognized, False otherwise.
- rtype:
bool
- pymkv.verify_recognized(file_path: str | PathLike[Any], mkvmerge_path: str | PathLike | Iterable[str] = 'mkvmerge') bool ¶
- Parameters:
file_path (Union[str, os.PathLike]) – The path to the file that will be verified.
mkvmerge_path (str, optional) – The path to the mkvmerge executable. Default is “mkvmerge”.
- Returns:
True if the container format of the file is recognized, False otherwise.
- Return type:
bool
- param file_path:
The path of the file to be verified.
- type file_path:
Union[str, os.PathLike]
- param mkvmerge_path:
The path to the mkvmerge executable. Defaults to “mkvmerge”.
- type mkvmerge_path:
str, optional
- returns:
Whether the container format of the file is supported by mkvmerge.
- rtype:
bool
- raises ValueError:
If the file cannot be opened or an error occurs during the verification process.
- pymkv.verify_supported(file_path: str | PathLike[Any], mkvmerge_path: str | PathLike | Iterable[str] = 'mkvmerge')¶
- Parameters:
file_path (Union[str, os.PathLike]) – The path of the file to be verified.
mkvmerge_path (str, optional) – The path to the mkvmerge executable. Defaults to “mkvmerge”.
- Returns:
Whether the container format of the file is supported by mkvmerge.
- Return type:
bool
- Raises:
ValueError – If the file cannot be opened or an error occurs during the verification process.