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

*class* · *dataclass*

```python
class InspectReport
```

Re-exported from: `ocx_sdk._results`

`ocx inspect` and `ocx package inspect` — the same envelope, both tiers.

**Attributes**

- `packages` (`tuple[InspectedPackage, ...]`) — One row per requested package or declared binding.
- `env` (`tuple[EnvEntry, ...]`) — The `[env]` entries those packages contribute, in order. Duplicates are allowed and meaningful — the merge folds them.
- `platform` (`str | None`) — The platform resolution ran against, under `--resolve`.

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

### ocx_sdk.InspectReport.env

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

```python
env: tuple[EnvEntry, ...] = ()
```

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

### ocx_sdk.InspectReport.packages

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

```python
packages: tuple[InspectedPackage, ...] = ()
```

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

### ocx_sdk.InspectReport.platform

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

```python
platform: str | None = None
```

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

### ocx_sdk.InspectReport.from_json

*method* · *classmethod*

```python
def from_json(raw: str) -> InspectReport
```

Parse `ocx --format json inspect` (or `package inspect`) output.

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