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 :py:attr:
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.
AUTO class-attribute
instance-attribute
¶
AUTO = 'auto'
Special file type for :py:attr:FileType.parse
.
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
25 26 |
|
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
324 325 326 327 |
|
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.
:force_ffprobe: Only rely on ffprobe to parse the file info.
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.
Returns:
-
ParsedFile
–ParsedFile object, holding the file's info.
Source code
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 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 |
|
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 :py:attr:
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.
AUTO class-attribute
instance-attribute
¶
AUTO = 'auto'
Special file type for :py:attr:FileType.parse
.
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
25 26 |
|
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
324 325 326 327 |
|
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.
:force_ffprobe: Only rely on ffprobe to parse the file info.
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.
Returns:
-
ParsedFile
–ParsedFile object, holding the file's info.
Source code
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 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 |
|