# 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.ConfigUpdateReport

*class* · *dataclass*

```python
class ConfigUpdateReport
```

Re-exported from: `ocx_sdk._results`

`ocx config update` — the managed-config tier's state.

`status` is the only field ocx always emits; the rest describe a tier that
is actually configured, and a `not_configured` answer carries none of them.

**Attributes**

- `status` (`str`) — `not_configured`, `already_current`, `updated`, `checked`, or `check_unavailable`.
- `source` (`str | None`) — The OCI reference the snapshot follows.
- `digest` (`str | None`) — The snapshot's digest.
- `policy` (`str | None`) — `apply`, `notify`, or `manual`.
- `tag` (`str | None`) — The tag the source resolved to.
- `fetched_at` (`str | None`) — When the snapshot was fetched.
- `paused_until` (`str | None`) — When an active pause expires.
- `pinned` (`str | None`) — The version a pin holds it at.
- `drift` (`Any`) — How the on-disk state diverged, carried untyped.
- `kill_switches` (`tuple[str, ...]`) — Kill switches the snapshot activates.

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

### ocx_sdk.ConfigUpdateReport.drift

*attribute* · *class attribute* · *instance attribute*

```python
drift: Any = None
```

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

### ocx_sdk.ConfigUpdateReport.fetched_at

*attribute* · *class attribute* · *instance attribute*

```python
fetched_at: str | None = None
```

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

### ocx_sdk.ConfigUpdateReport.kill_switches

*attribute* · *class attribute* · *instance attribute*

```python
kill_switches: tuple[str, ...] = ()
```

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

## ocx_sdk.CopiedPlatformRow

*class* · *dataclass*

```python
class CopiedPlatformRow
```

Re-exported from: `ocx_sdk._results`

One platform `copy` carried over to the target (C-015, `package_copy.rs:128-136`).

**Attributes**

- `platform` (`str`) — The platform this row describes.
- `digest` (`str`) — The platform manifest's digest at the target.
- `disposition` (`str`) — What happened to this platform's manifest at the target — a D8 kebab-case scalar enum: `"added"`, `"unchanged"`, `"replaced"`, or `"kept-not-in-source"` (`ocx_lib/src/publisher/copy.rs:208-219`). Always present.

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

### ocx_sdk.CopiedPlatformRow.digest

*attribute* · *instance attribute*

```python
digest: str
```

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

### ocx_sdk.CopiedPlatformRow.disposition

*attribute* · *instance attribute*

```python
disposition: str
```

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

### ocx_sdk.CopiedPlatformRow.platform

*attribute* · *instance attribute*

```python
platform: str
```

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

### ocx_sdk.CopiedPlatformRow.from_dict

*method* · *classmethod*

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

Build from one decoded entry of `CopyReport.platforms`.

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