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

*class* · *dataclass*

```python
class Candidate
```

Re-exported from: `ocx_sdk._results`

One platform's manifest for a package, as `inspect` lists it.

`media_type` and `size` are present on the `package inspect` tier only;
the toolchain tier omits them.

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

### ocx_sdk.Candidate.digest

*attribute* · *instance attribute*

```python
digest: str
```

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

### ocx_sdk.Candidate.media_type

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

```python
media_type: str | None = None
```

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

### ocx_sdk.Candidate.pinned

*attribute* · *instance attribute*

```python
pinned: str
```

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

### ocx_sdk.Candidate.platform

*attribute* · *instance attribute*

```python
platform: str
```

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

### ocx_sdk.Candidate.size

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

```python
size: int | None = None
```

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

### ocx_sdk.Candidate.ref

*property*

```python
ref: PackageRef
```

The pinned identifier, ready for the next call's argv.

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

### ocx_sdk.Candidate.from_dict

*method* · *classmethod*

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

Build from one decoded entry of a package's `candidates` array.

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