utils.rm_suffix#
Back to Module page
Summary#
Utility to change the extension of a path
Signature#
def rm_suffix(filepath, suffix = '.json', new_suffix = None)
Name |
Type |
Default |
Description |
|---|---|---|---|
|
String or an instance of pathlib.PosixPath |
||
|
‘.json’ |
Suffix to remove. Pass ‘.\*’ to remove any existing extension |
|
|
None |
Suffix to add, if desired |
Output variables#
Return annotation |
Docstring type |
Description |
|---|---|---|
|
Docstring#
Utility to change the extension of a path
:param filepath: String or an instance of pathlib.PosixPath
:param suffix: Suffix to remove. Pass '.*' to remove any existing extension
:param new_suffix: Suffix to add, if desired
:return: