get_ext#

get_ext(file_path: Union[str, cloudpathlib.cloudpath.CloudPath, pathlib.Path]) str[source]#

Get file extension from file path, ie: WITHOUT THE FIRST POINT

>>> file_path = 'D:/path/to/filename.zip'
>>> get_file_name(file_path)
'zip'
Parameters

file_path (Union[str, CloudPath, Path]) – Absolute or relative file path (the file doesn’t need to exist)

Returns

File name (without extension)

Return type

str