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

*class* · *dataclass*

```python
class RemovalResult
```

Re-exported from: `ocx_sdk._results`

One row of `package uninstall` or `package deselect`.

Both commands return a bare array rather than a keyed object — the only
two package-tier mutators that do.

**Attributes**

- `package` (`str`) — The identifier as given.
- `status` (`str`) — What happened, e.g. `"removed"`.
- `path` (`str | None`) — The symlink that went away, or `None` when there was none — always-present-nullable (`removed.rs:40`), which every `status: "absent"` row answers with.

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

### ocx_sdk.RemovalResult.package

*attribute* · *instance attribute*

```python
package: str
```

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

### ocx_sdk.RemovalResult.path

*attribute* · *instance attribute*

```python
path: str | None
```

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

### ocx_sdk.RemovalResult.status

*attribute* · *instance attribute*

```python
status: str
```

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

### ocx_sdk.RemovalResult.ref

*property*

```python
ref: PackageRef
```

The removed package, as a `PackageRef`.

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

### ocx_sdk.RemovalResult.from_dict

*method* · *classmethod*

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

Build from one decoded array entry.

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