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

*class* · *dataclass*

```python
class CleanEntry
```

Re-exported from: `ocx_sdk._results`

One thing `ocx clean` removed, or would remove.

**Attributes**

- `kind` (`str`) — `"object"` for a store object, `"temp"` for a temp directory, or `"consent"` for a `state/projects/<key>/` directory whose consent stamp was swept — the entry that revokes a project's shell activation, which is why a preview names it. Raw `str` (D8).
- `dry_run` (`bool`) — Whether this was a preview.
- `path` (`str`) — What was (or would be) removed.
- `held_by` (`tuple[str, ...]`) — Project `ocx.lock` paths holding the entry; empty when no registered project protects it, or under `--force`.

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

### ocx_sdk.CleanEntry.dry_run

*attribute* · *instance attribute*

```python
dry_run: bool
```

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

### ocx_sdk.CleanEntry.held_by

*attribute* · *instance attribute*

```python
held_by: tuple[str, ...]
```

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

### ocx_sdk.CleanEntry.kind

*attribute* · *instance attribute*

```python
kind: str
```

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

### ocx_sdk.CleanEntry.path

*attribute* · *instance attribute*

```python
path: str
```

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

### ocx_sdk.CleanEntry.from_dict

*method* · *classmethod*

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

Build from one decoded array entry.

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