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

*class* · *dataclass*

```python
class EnvEntry
```

Re-exported from: `ocx_sdk._results`

One `[env]` contribution from `ocx env`.

**Attributes**

- `key` (`str`) — The variable name.
- `type` (`EnvEntryType`) — How the value folds onto the parent environment.
- `value` (`str`) — The contribution, verbatim. ocx has already resolved its own `${...}` grammar by the time it reaches us.
- `separator` (`str | None`) — The separator a `list` entry folds with, when its project declared one. `None` — always, for the other two types — takes `_envmodel`'s default, which is ocx's own.

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

### ocx_sdk.EnvEntry.key

*attribute* · *instance attribute*

```python
key: str
```

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

### ocx_sdk.EnvEntry.separator

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

```python
separator: str | None = None
```

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

### ocx_sdk.EnvEntry.type

*attribute* · *instance attribute*

```python
type: EnvEntryType
```

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

### ocx_sdk.EnvEntry.value

*attribute* · *instance attribute*

```python
value: str
```

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

### ocx_sdk.EnvEntry.from_dict

*method* · *classmethod*

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

Build from one decoded entry of an `entries` array.

**Raises**

- `ValueError` — The entry declares a type this SDK cannot fold.

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