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

*attribute*

```python
InfoResult
```

Re-exported from: `ocx_sdk._results`

`package description pull`, keyed by identifier as given.

The value is `None` whenever the registry holds no description metadata at
all — distinct from a `PackageDescription` whose every field is `None`, which
is a description the registry holds and has left blank.

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

## ocx_sdk.IndexFinding

*class* · *dataclass*

```python
class IndexFinding
```

Re-exported from: `ocx_sdk._results`

Where the public index disagrees with the registry about an alias.

Internally tagged on `finding`: `stale` carries the two digests, and
`not-committed` carries only the tag. Reported for `ocx.sh/...` packages
alone, and never fixed by `repair` — announcing the tag is what fixes it.

**Attributes**

- `tag` (`str`) — The rolling tag.
- `finding` (`str`) — `"stale"` or `"not-committed"`, raw `str` (D8).
- `committed` (`str | None`) — The digest the index committed, under `stale`.
- `live` (`str | None`) — The digest the alias points at today, under `stale`.

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

### ocx_sdk.IndexFinding.committed

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

```python
committed: str | None = None
```

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

### ocx_sdk.IndexFinding.finding

*attribute* · *instance attribute*

```python
finding: str
```

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

### ocx_sdk.IndexFinding.live

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

```python
live: str | None = None
```

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

### ocx_sdk.IndexFinding.tag

*attribute* · *instance attribute*

```python
tag: str
```

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

### ocx_sdk.IndexFinding.from_dict

*method* · *classmethod*

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

Build from one decoded `index_findings` entry.

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