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

*class* · *dataclass*

```python
class DryRunEntry
```

Re-exported from: `ocx_sdk._results`

One row of `pull(dry_run=True)` — what a real pull would do to a package.

`pull_dry_run.rs:76` serializes the preview as a **bare root array**, so
there is no envelope object and no wrapper struct here: the rows are the
document (D11).

**Attributes**

- `package` (`str`) — The pinned identifier the row is about.
- `status` (`str`) — `"cached"` or `"would-fetch"`, carried as a raw `str` (D8).
- `path` (`str | None`) — Where the package already sits, or `None` when nothing is cached — always-present-nullable (D7), and `null` on exactly the `would-fetch` rows this preview exists to surface.

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

### ocx_sdk.DryRunEntry.package

*attribute* · *instance attribute*

```python
package: str
```

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

### ocx_sdk.DryRunEntry.path

*attribute* · *instance attribute*

```python
path: str | None
```

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

### ocx_sdk.DryRunEntry.status

*attribute* · *instance attribute*

```python
status: str
```

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

### ocx_sdk.DryRunEntry.ref

*property*

```python
ref: PackageRef
```

The previewed package, as a `PackageRef`.

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

### ocx_sdk.DryRunEntry.from_dict

*method* · *classmethod*

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

Build from one decoded array entry.

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