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

*class* · *dataclass*

```python
class CascadeCheckReport
```

Re-exported from: `ocx_sdk._results`

`ocx package cascade check` — one audit per package, in input order.

**Report-then-fail**: a finding makes the process exit 65 *with* this
document on stdout, so the client tolerates that code and hands the
report back as a result (`tolerated_report`). `exit_code` is the process's
own, carried so a caller can branch without re-deriving it from the rows.

**Attributes**

- `reports` (`tuple[CascadeReport, ...]`) — One entry per package audited.
- `exit_code` (`int`) — `0` when everything agreed, `65` when anything did not.

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

### ocx_sdk.CascadeCheckReport.exit_code

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

```python
exit_code: int = 0
```

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

### ocx_sdk.CascadeCheckReport.reports

*attribute* · *instance attribute*

```python
reports: tuple[CascadeReport, ...]
```

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

### ocx_sdk.CascadeCheckReport.clean

*property*

```python
clean: bool
```

Whether the audit found nothing — the exit code's answer.

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

### ocx_sdk.CascadeCheckReport.from_json

*method* · *classmethod*

```python
def from_json(raw: str, *, exit_code: int = 0) -> CascadeCheckReport
```

Parse `ocx --format json package cascade check` output.

**Parameters**

- `raw` (`str`) — Captured stdout.
- `exit_code` (`int`) (default: `0`) — The process's exit status, carried onto the result.

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