check_relpath

pydriosm.utils.check_relpath(pathname, start='.')[source]

Check and return a relative pathname to the given pathname.

On Windows, when pathname and start are on different drives, the function returns the given pathname.

Parameters:
  • pathname (str | os.PathLike[str]) – pathname of a file or a directory

  • start (str | os.PathLike[str]) – optional start directory, defaults to os.curdir (i.e. the current working directory)

Returns:

relative pathname to the given pathname

Type:

str | os.PathLike[str]