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

*class*

```python
class AuthError(OcxProcessError)
```

Bases: `ocx_sdk._errors.OcxProcessError`

Re-exported from: `ocx_sdk._errors`

Registry authentication or authorization failed (exit 80).

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

## ocx_sdk.BootstrapError

*class*

```python
class BootstrapError(OcxError)
```

Bases: `ocx_sdk._errors.OcxError`

Re-exported from: `ocx_sdk._errors`

Base for failures while resolving, downloading, or installing an ocx binary.

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

## ocx_sdk.ChecksumMismatchError

*class*

```python
class ChecksumMismatchError(BootstrapError)
```

Bases: `ocx_sdk._errors.BootstrapError`

Re-exported from: `ocx_sdk._errors`

A downloaded artifact did not match the sha256 the manifest declared.

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

## ocx_sdk.ConfigError

*class*

```python
class ConfigError(OcxProcessError)
```

Bases: `ocx_sdk._errors.OcxProcessError`

Re-exported from: `ocx_sdk._errors`

ocx's configuration is missing or invalid (exit 78).

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

## ocx_sdk.DataError

*class*

```python
class DataError(OcxProcessError)
```

Bases: `ocx_sdk._errors.OcxProcessError`

Re-exported from: `ocx_sdk._errors`

Input or resolved data was malformed, ambiguous, or platform-mismatched (exit 65).

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

## ocx_sdk.DirtyRcBlockError

*class*

```python
class DirtyRcBlockError(OcxProcessError)
```

Bases: `ocx_sdk._errors.OcxProcessError`

Re-exported from: `ocx_sdk._errors`

A managed-config fence carried local edits and refused to overwrite them (exit 82).

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

## ocx_sdk.DistManifestError

*class*

```python
class DistManifestError(BootstrapError)
```

Bases: `ocx_sdk._errors.BootstrapError`

Re-exported from: `ocx_sdk._errors`

A dist manifest was malformed, unparseable, or failed field validation.

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

## ocx_sdk.DownloadError

*class*

```python
class DownloadError(BootstrapError)
```

Bases: `ocx_sdk._errors.BootstrapError`

Re-exported from: `ocx_sdk._errors`

A manifest or artifact could not be fetched.

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

## ocx_sdk.ExitCode

*class*

```python
class ExitCode(IntEnum)
```

Bases: `IntEnum`

Re-exported from: `ocx_sdk._errors`

Exit codes ocx assigns to error categories (`sysexits.h` plus ocx's own).

`TEMP_FAIL` is the retry signal — ocx maps 429/5xx/network timeouts onto
it, while `UNAVAILABLE` marks a failure that retrying cannot fix.

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

### ocx_sdk.ExitCode.AUTH

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

```python
AUTH = 80
```

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