get_ext#
- get_ext(file_path: str | CloudPath | Path) str [source]#
Deprecated since version 1.30.0: Import it from
sertit.path
instead ofsertit.files
Get file extension from file path.
Warning
Extension is given WITHOUT THE FIRST POINT
- Parameters:
file_path (AnyPathStrType) – Absolute or relative file path (the file doesn’t need to exist)
- Returns:
File name (without extension)
- Return type:
Example
>>> file_path = 'D:/path/to/filename.zip' >>> get_ext(file_path) 'zip'