module documentation

Undocumented

Function parse_manifest_path Parse a path string from a dataset manifest on the current OS.
Function path_to_posix Serialize a path with forward slashes for portable manifests.
Function resolve_manifest_path Resolve a manifest path relative to the directory that contains it.
def parse_manifest_path(value: PathType) -> Path:

Parse a path string from a dataset manifest on the current OS.

Examples

>>> parse_manifest_path("images/cat.jpg").as_posix()
'images/cat.jpg'
>>> parse_manifest_path(r"images\\cat.jpg").as_posix()
'images/cat.jpg'
Parameters
value:PathTypePath value read from a manifest.
Returns
PathParsed path. Relative Windows paths are converted to POSIX-style components before constructing the current-platform Path.
def path_to_posix(value: PathType) -> str:

Serialize a path with forward slashes for portable manifests.

Examples

>>> path_to_posix(Path("images") / "cat.jpg")
'images/cat.jpg'
>>> path_to_posix(r"images\\cat.jpg")
'images/cat.jpg'
Parameters
value:PathTypePath value to serialize.
Returns
strPOSIX-style path string.
def resolve_manifest_path(base_dir: Path, value: PathType) -> Path:

Resolve a manifest path relative to the directory that contains it.

Parameters
base_dir:PathDirectory relative paths are resolved against.
value:PathTypePath value read from a manifest.
Returns
PathAbsolute resolved path.