# ocx_sdk

*module*

Python SDK for [OCX](https://github.com/ocx-sh/ocx).

`ocx-sdk` drives the ocx binary rather than reimplementing it: ocx owns
resolution, verification, and the identifier grammar, and this package gives
you typed, CWD-independent handles over the commands it exposes.

```python
from ocx_sdk import Ocx, bootstrap

ocx = Ocx(exe=bootstrap.ensure())
project = ocx.project("/srv/build")
project.pull()
project.exec(["task", "verify"])
```

**This module is the API.** Everything listed in `__all__` is the stable
surface; every other module is underscored and package-private, and the one
public submodule is `ocx_sdk.bootstrap`. Reaching into an underscored path
means the next release may move it without notice — pre-1.0, breaking
changes ship without shims.

Start at `Ocx` for the runtime API and `bootstrap.ensure` for provisioning.

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/__init__.py#L1-L1)

## ocx_sdk.SlotRow

*class* · *dataclass*

```python
class SlotRow
```

Re-exported from: `ocx_sdk._results`

One (rolling tag, platform) slot `cascade check` examined.

**Attributes**

- `tag` (`str`) — The rolling tag — `latest`, `3`, `3.28`, or a variant name.
- `platform` (`Mapping[str, Any]`) — The OCI platform object of the slot, carried untyped: the published schema types it as `true` (anything), and no dispatch here needs its fields.
- `status` (`str`) — `ok`, `missing`, `stale`, `orphan` or `duplicate` — the finding, as raw `str` (D8). Anything but `ok` is what makes `check` exit 65.
- `observed` (`str | None`) — The digest the alias carries for this platform, if any.
- `expected` (`str | None`) — The digest the fold expects, if any.
- `source` (`str | None`) — The version the expectation was folded from, e.g. `"1.0.1"`, or `None`. Published as `PackageVersion` (a string) since 0.6.2; 0.6.1's schema named an integer `Version` here, a generator artifact the wire never bore out (ocx-sh/ocx#460).
- `observed_source` (`str | None`) — The version the observed digest belongs to, or `None` when the alias points at content no observed leaf carries.

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2533-L2574)

### ocx_sdk.SlotRow.expected

*attribute* · *instance attribute*

```python
expected: str | None
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2559-L2559)

### ocx_sdk.SlotRow.observed

*attribute* · *instance attribute*

```python
observed: str | None
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2558-L2558)

### ocx_sdk.SlotRow.observed_source

*attribute* · *instance attribute*

```python
observed_source: str | None
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2561-L2561)

### ocx_sdk.SlotRow.platform

*attribute* · *instance attribute*

```python
platform: Mapping[str, Any]
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2556-L2556)

### ocx_sdk.SlotRow.source

*attribute* · *instance attribute*

```python
source: str | None
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2560-L2560)

### ocx_sdk.SlotRow.status

*attribute* · *instance attribute*

```python
status: str
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2557-L2557)

### ocx_sdk.SlotRow.tag

*attribute* · *instance attribute*

```python
tag: str
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2555-L2555)

### ocx_sdk.SlotRow.from_dict

*method* · *classmethod*

```python
def from_dict(data: Mapping[str, Any]) -> SlotRow
```

Build from one decoded `rows` entry.

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_results.py#L2563-L2574)
