path_utils#

Utility functions for working with paths

clean_path(path: str | Path) str[source]#

Expand user (~) and normalize path.

de_duplicate_path(root: Path, sub_dir) Path[source]#

Remove sub_dir from root if root already ends with sub_dir

Parameters:
  • root (Path) – The root path

  • sub_dir (Path) – The sub directory to check

Returns

Path

The cleaned sub directory