real_rel_path

Contents

real_rel_path#

real_rel_path(raw_path: str | CloudPath | Path, start: str | CloudPath | Path) → CloudPath | Path[source]#

Gives the real relative path from a starting folder. (and not just adding ../.. between the start and the target)

Parameters:
Returns:

Relative path

Example

>>> path = r'D:/_SERTIT_UTILS/sertit-utils/sertit'
>>> start = os.path.join(".", "..", "..")
>>> real_rel_path(path, start)
'sertit-utils/sertit'