get_filename#

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

Get file name (without extension) from file path, ie:

>>> file_path = 'D:/path/to/filename.zip'
>>> get_file_name(file_path)
'filename'
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