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

*class* · *dataclass*

```python
class PackageBinding
```

Re-exported from: `ocx_sdk._results`

A name a package provides — the row shape `binaries` and `entrypoints` share.

**Attributes**

- `name` (`str`) — The binary or entrypoint name the package claims.
- `package` (`str | None`) — The package that claimed it, or `None` when ocx could not attribute the claim. Absent-when-unattributed (D7): `env.rs:100` skips the key, and its own doc reserves `None` for a future source with no clean attribution.

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

### ocx_sdk.PackageBinding.name

*attribute* · *instance attribute*

```python
name: str
```

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

### ocx_sdk.PackageBinding.package

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

```python
package: str | None = None
```

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

### ocx_sdk.PackageBinding.ref

*property*

```python
ref: PackageRef | None
```

The providing package, as a `PackageRef`, or `None` when unattributed.

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

### ocx_sdk.PackageBinding.from_dict

*method* · *classmethod*

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

Build from one decoded `binaries` or `entrypoints` entry.

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