# helia_aot.registry

## Registry API

Generic thread-safe registry primitives used by the explicit `RegistryContext`.

**Re-exports**

| Name | Source |
| --- | --- |
| [RegistryBundle](/helia-aot/reference/api/helia_aot/registry/context/#helia_aot.registry.context.RegistryBundle) | `helia_aot.registry.context.RegistryBundle` |
| [RegistryContext](/helia-aot/reference/api/helia_aot/registry/context/#helia_aot.registry.context.RegistryContext) | `helia_aot.registry.context.RegistryContext` |
| [build_default_registry_context](/helia-aot/reference/api/helia_aot/registry/context/#helia_aot.registry.context.build_default_registry_context) | `helia_aot.registry.context.build_default_registry_context` |

## helia_aot.registry.Registry

`class` · `python`

```python
Registry(*, key_encoder: Callable[[K], str] | None = None)
```

Thread-safe registry with optional key encoding.

Source: `helia_aot/registry/__init__.py:24`

### helia_aot.registry.Registry.register

`method` · `python`

```python
register(key: K, item: T, *, overwrite: bool = False) -> None
```

Register an item under the given key.

Source: `helia_aot/registry/__init__.py:36`

### helia_aot.registry.Registry.unregister

`method` · `python`

```python
unregister(key: K) -> None
```

Unregister an item if present.

Source: `helia_aot/registry/__init__.py:46`

### helia_aot.registry.Registry.get

`method` · `python`

```python
get(key: K) -> T
```

Get a registered item by key.

Source: `helia_aot/registry/__init__.py:54`

### helia_aot.registry.Registry.has

`method` · `python`

```python
has(key: K) -> bool
```

Check if an item is registered.

Source: `helia_aot/registry/__init__.py:58`

### helia_aot.registry.Registry.list

`method` · `python`

```python
list() -> builtins.list[str]
```

List registered encoded key names.

Source: `helia_aot/registry/__init__.py:62`

### helia_aot.registry.Registry.decorator

`method` · `python`

```python
decorator(key: K, *, overwrite: bool = False) -> Callable[[T], T]
```

Decorator helper to register callables/classes.

Source: `helia_aot/registry/__init__.py:66`

### helia_aot.registry.Registry.freeze

`method` · `python`

```python
freeze() -> None
```

Prevent modifications; useful after bootstrapping built-ins.

Source: `helia_aot/registry/__init__.py:75`

### helia_aot.registry.Registry.unfreeze

`method` · `python`

```python
unfreeze() -> None
```

Allow modifications again.

Source: `helia_aot/registry/__init__.py:80`

### helia_aot.registry.Registry.clear

`method` · `python`

```python
clear() -> None
```

Remove all items from the registry.

Source: `helia_aot/registry/__init__.py:85`

### helia_aot.registry.Registry.items

`method` · `python`

```python
items() -> Iterable[tuple[str, T]]
```

Iterate over encoded key, item pairs.

Source: `helia_aot/registry/__init__.py:92`
