from_extension method

On this page

from_extension

Maps the file extension to the file type.

def from_extension(cls, extension):
    ...
Parameter Type Description
extension str The file extension (including the period “.”).

Returns: FileType: When the file type is supported returns it, otherwise returns the default FileType.unknown file type.

Raises Description
ValueError Thrown when extension is null or empty string.

See Also

On this page