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

*class* · *dataclass*

```python
class Integration
```

Re-exported from: `ocx_sdk._results`

A tool integration a package declares, with its payload carried untyped.

**Attributes**

- `namespace` (`str`) — The integration namespace the package declares.
- `package` (`str | None`) — The declaring package, or `None` when ocx could not attribute the contribution — `env.rs:137` skips the key for the same reason `PackageBinding.package` does (D7).
- `payload` (`Mapping[str, Any]`) — The interpolated payload, uninterpreted.

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

### ocx_sdk.Integration.namespace

*attribute* · *instance attribute*

```python
namespace: str
```

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

### ocx_sdk.Integration.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#L926-L926)

### ocx_sdk.Integration.payload

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

```python
payload: Mapping[str, Any] = _EMPTY
```

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

### ocx_sdk.Integration.ref

*property*

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

The declaring 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#L930-L932)

### ocx_sdk.Integration.from_dict

*method* · *classmethod*

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

Build from one decoded `integrations` entry.

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