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

*class* · *dataclass*

```python
class DepNode
```

Re-exported from: `ocx_sdk._results`

One node of the `package deps` tree.

**Attributes**

- `identifier` (`str`) — The pinned identifier.
- `repeated` (`bool`) — This node already appeared elsewhere in the tree; its children are not repeated under it.
- `visibility` (`str | None`) — How the parent exposes it, when the parent says.
- `dependencies` (`tuple[Mapping[str, Any], ...]`) — Child nodes, carried untyped. The only probe available had no dependencies, so the populated child shape is UNCONFIRMED — re-model this as `tuple[DepNode, ...]` once a real dependency edge is recorded.

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

### ocx_sdk.DepNode.dependencies

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

```python
dependencies: tuple[Mapping[str, Any], ...] = ()
```

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

### ocx_sdk.DepNode.identifier

*attribute* · *instance attribute*

```python
identifier: str
```

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

### ocx_sdk.DepNode.repeated

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

```python
repeated: bool = False
```

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

### ocx_sdk.DepNode.visibility

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

```python
visibility: str | None = None
```

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

### ocx_sdk.DepNode.ref

*property*

```python
ref: PackageRef
```

This node's package, as a `PackageRef`.

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

### ocx_sdk.DepNode.from_dict

*method* · *classmethod*

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

Build from one decoded node of the `roots` array.

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