# path

Python API: `luxonis_ml.utils.path`

## Functions

### parse_manifest_path

```python
def parse_manifest_path(value: PathType) -> Path:
```

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

> **Examples**
> ```pycon
>>> 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` (`PathType`): Path value read from a manifest.

Returns

 * `Path`: Parsed path. Relative Windows paths are converted to POSIX-style components before constructing the current-platform `Path`.

### path_to_posix

```python
def path_to_posix(value: PathType) -> str:
```

Serialize a path with forward slashes for portable manifests.

> **Examples**
> ```pycon
>>> path_to_posix(Path("images") / "cat.jpg")
'images/cat.jpg'
>>> path_to_posix(r"images\\cat.jpg")
'images/cat.jpg'
```

Parameters

 * `value` (`PathType`): Path value to serialize.

Returns

 * `str`: POSIX-style path string.

### resolve_manifest_path

```python
def resolve_manifest_path(base_dir: Path, value: PathType) -> Path:
```

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

Parameters

 * `base_dir` (`Path`): Directory relative paths are resolved against.
 * `value` (`PathType`): Path value read from a manifest.

Returns

 * `Path`: Absolute resolved path.
