mime_base ¶
Classes:
FileTypeBase ¶
Bases: FileTypeIndexBase
, CustomStrEnum
Attributes:
-
INDEX
(FileTypeIndex
) –File type representing an indexing file.
FileTypeIndex ¶
Bases: FileType
Methods:
-
__call__
–Instantiate FileType.INDEX with its own sub-FileType.
-
is_index
–Verify whether the FileType is an INDEX that holds its own FileType (e.g. mime: index/video).
-
parse
–Parse infos from a file. If the FileType is different than AUTO, this function will throw if the file
Attributes:
-
ARCHIVE
–File type for archive files.
-
AUDIO
–File type for audio files.
-
AUTO
–Special file type for FileType.parse.
-
CHAPTERS
–File type for chapters files.
-
DOCUMENT
–File type for documents.
-
FONT
–File type for font files.
-
IMAGE
–File type for image files.
-
INDEX
– -
INDEX_AUDIO
– -
INDEX_VIDEO
– -
OTHER
–File type for generic files, like applications.
-
VIDEO
–File type for video files.
OTHER class-attribute
instance-attribute
¶
OTHER = 'other'
File type for generic files, like applications.
__call__ ¶
__call__(file_type: str | FileType) -> FileTypeIndexWithType
Instantiate FileType.INDEX with its own sub-FileType.
Source code
24 25 26 27 28 |
|
is_index ¶
is_index() -> TypeGuard[FileTypeIndexWithType]
Verify whether the FileType is an INDEX that holds its own FileType (e.g. mime: index/video).
Source code
364 365 366 367 368 369 |
|
parse ¶
parse(
path: FilePathType,
*,
func: FuncExceptT | None = None,
force_ffprobe: bool | None = None
) -> ParsedFile
Parse infos from a file. If the FileType is different than AUTO, this function will throw if the file is a different FileType than what this method was called on.
Parameters:
-
path
¶FilePathType
) –Path of the file to be parsed.
-
func
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling. This should only be set by VS package developers.
:force_ffprobe: Only rely on ffprobe to parse the file info.
Returns:
-
ParsedFile
–ParsedFile object, holding the file's info.
Source code
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
|
FileTypeIndexBase ¶
FileTypeIndexWithType ¶
Bases: FileTypeIndex
Methods:
-
__call__
–Instantiate FileType.INDEX with its own sub-FileType.
-
is_index
–Verify whether the FileType is an INDEX that holds its own FileType (e.g. mime: index/video).
-
parse
–Parse infos from a file. If the FileType is different than AUTO, this function will throw if the file
Attributes:
-
ARCHIVE
–File type for archive files.
-
AUDIO
–File type for audio files.
-
AUTO
–Special file type for FileType.parse.
-
CHAPTERS
–File type for chapters files.
-
DOCUMENT
–File type for documents.
-
FONT
–File type for font files.
-
IMAGE
–File type for image files.
-
INDEX
– -
INDEX_AUDIO
– -
INDEX_VIDEO
– -
OTHER
–File type for generic files, like applications.
-
VIDEO
–File type for video files.
-
file_type
(FileType
) –Sub-FileType that the index file indexes.
OTHER class-attribute
instance-attribute
¶
OTHER = 'other'
File type for generic files, like applications.
__call__ ¶
__call__(file_type: str | FileType) -> FileTypeIndexWithType
Instantiate FileType.INDEX with its own sub-FileType.
Source code
24 25 26 27 28 |
|
is_index ¶
is_index() -> TypeGuard[FileTypeIndexWithType]
Verify whether the FileType is an INDEX that holds its own FileType (e.g. mime: index/video).
Source code
364 365 366 367 368 369 |
|
parse ¶
parse(
path: FilePathType,
*,
func: FuncExceptT | None = None,
force_ffprobe: bool | None = None
) -> ParsedFile
Parse infos from a file. If the FileType is different than AUTO, this function will throw if the file is a different FileType than what this method was called on.
Parameters:
-
path
¶FilePathType
) –Path of the file to be parsed.
-
func
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling. This should only be set by VS package developers.
:force_ffprobe: Only rely on ffprobe to parse the file info.
Returns:
-
ParsedFile
–ParsedFile object, holding the file's info.
Source code
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
|