rel_path_unix
- ketos.data_handling.data_handling.rel_path_unix(path, start=None)[source]
Return a relative unix filepath to path either from the current directory or from an optional start directory.
- Args:
- path: str
Path. Can be unix or windows format.
- start: str
Optional start directory. Can be unix or windows format.
- Returns:
- u: str
Relative unix filepath
- Examples:
>>> from ketos.data_handling.data_handling import rel_path_unix >>> path = "/home/me/documents/projectX/file1.pdf" >>> start = "/home/me/documents/" >>> u = rel_path_unix(path, start) >>> print(u) /projectX/