# path

Python API: `luxonis_ml.utils.path`

## Functions

| Name | Description |
| --- | --- |
|
[`parse_manifest_path`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/utils/path.md)
| Parse a path string from a dataset manifest on the current OS. |
|
[`path_to_posix`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/utils/path.md)
| Serialize a path with forward slashes for portable manifests. |
|
[`resolve_manifest_path`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/utils/path.md)
| Resolve a manifest path relative to the directory that contains it. |

### function `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'
```

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `value` | `PathType` | Path value read from a manifest. | required |

Returns

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

### function `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'
```

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `value` | `PathType` | Path value to serialize. | required |

Returns

| Type | Description |
| --- | --- |
| `str` | POSIX-style path string. |

### function `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.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `base_dir` | `Path` | Directory relative paths are resolved against. | required |
| `value` | `PathType` | Path value read from a manifest. | required |

Returns

| Type | Description |
| --- | --- |
| `Path` | Absolute resolved path. |
