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

*class* · *dataclass*

```python
class BlobSummary
```

Re-exported from: `ocx_sdk._results`

Blob transfer counts for one `copy` (C-015, `package_copy.rs:140-147`).

**Not** push's `layers` — that is a different struct (`LayerCounts`,
`oci/client.rs:75-84`) with a different field set,
`{mounted, uploaded, verified}`. Copy tracks transfer method including
blobs that needed no transfer at all; push tracks mount/upload/verify-
by-digest. Reusing push's shape here would look for a `verified` key
that copy never sends and silently drop `present` — the D7 failure
class this module exists to avoid.

**Attributes**

- `present` (`int`) — Blobs already present at the target — no transfer needed.
- `mounted` (`int`) — Blobs mounted from another repository without a re-upload.
- `uploaded` (`int`) — Blobs actually transferred.

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

### ocx_sdk.BlobSummary.mounted

*attribute* · *instance attribute*

```python
mounted: int
```

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

### ocx_sdk.BlobSummary.present

*attribute* · *instance attribute*

```python
present: int
```

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

### ocx_sdk.BlobSummary.uploaded

*attribute* · *instance attribute*

```python
uploaded: int
```

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

### ocx_sdk.BlobSummary.from_dict

*method* · *classmethod*

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

Build from the decoded `blobs` object.

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