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

*class* · *dataclass*

```python
class ListingSummary
```

Re-exported from: `ocx_sdk._results`

The `summary` block of an `SbomListingReport` (C-014).

`sbom.rs:75`. All seven fields are always present.

**Attributes**

- `status` (`str`) — `"success"` or `"partial_failure"` — a listing can refuse individual candidates and still exit 0 (D10's note that this differs from a swept `sign`/`attest`, which exits non-zero on a partial failure).
- `verification` (`str`) — `"verified"` or `"unverified"`, carried as raw `str` (D8) — ocx's `ListingVerification`, lowercase on the wire.
- `exit_code` (`int`) — The process's own exit code.
- `total` (`int`) — Candidates examined.
- `verified` (`int`) — Candidates whose signature verified.
- `unverified` (`int`) — Candidates attached without a verifying signature.
- `refused` (`int`) — Candidates rejected outright — see `RefusedEntry`.

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

### ocx_sdk.ListingSummary.exit_code

*attribute* · *instance attribute*

```python
exit_code: int
```

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

### ocx_sdk.ListingSummary.refused

*attribute* · *instance attribute*

```python
refused: int
```

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

### ocx_sdk.ListingSummary.status

*attribute* · *instance attribute*

```python
status: str
```

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

### ocx_sdk.ListingSummary.total

*attribute* · *instance attribute*

```python
total: int
```

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

### ocx_sdk.ListingSummary.unverified

*attribute* · *instance attribute*

```python
unverified: int
```

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

### ocx_sdk.ListingSummary.verification

*attribute* · *instance attribute*

```python
verification: str
```

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

### ocx_sdk.ListingSummary.verified

*attribute* · *instance attribute*

```python
verified: int
```

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

### ocx_sdk.ListingSummary.from_dict

*method* · *classmethod*

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

Build from the decoded `summary` object.

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