---
sidebar:
  hidden: true
title: roboto.storage.object_store.registry
---
## Module Contents

### StoreRegistry

```python
class roboto.storage.object_store.registry.StoreRegistry
```

`from roboto.storage.object_store import StoreRegistry`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/storage/object_store/registry.py#L18-L70)

Registry of object store classes, keyed by the URI scheme each one handles.

[`upload()`](/docs/reference/python-sdk/roboto/storage/file_service#roboto.storage.file_service.FileService.upload) and [`download()`](/docs/reference/python-sdk/roboto/storage/file_service#roboto.storage.file_service.FileService.download) choose the store for each file through it, so most code never calls it. [`S3Store`](/docs/reference/python-sdk/roboto/storage/object_store/s3#roboto.storage.object_store.s3.S3Store) registers itself for `s3`. Registrations are held on the class, so they apply to the whole process.

#### StoreRegistry.get_store_for_uri()

```python
@classmethod
def get_store_for_uri(
    uri: str,
    credential_provider: roboto.storage.object_store.object_store.CredentialProvider,
    **kwargs,
) -> roboto.storage.object_store.object_store.ObjectStore
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/storage/object_store/registry.py#L50-L70)

Build a store of the class registered for a URI's scheme.

Only the scheme is read from `uri`; the store is built by the registered class's [`create()`](/docs/reference/python-sdk/roboto/storage/object_store/object_store#roboto.storage.object_store.object_store.ObjectStore.create).

**Parameters**

- **uri** (`str`): URI of an object in the store, such as `s3://my-bucket/folder/data.csv`.
- **credential_provider** (`roboto.storage.object_store.object_store.CredentialProvider`): Callable that returns credentials for the store, passed to `create`.
- **`\*\*kwargs`**: Further arguments passed to `create`.

**Raises**

- `ValueError`: No class is registered for the URI's scheme.

**Returns**

- `roboto.storage.object_store.object_store.ObjectStore`

#### StoreRegistry.register()

```python
@classmethod
def register(scheme: str)
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/storage/object_store/registry.py#L29-L47)

Build a class decorator that registers the decorated store class for a URI scheme.

The decorator returns the class unchanged.

**Parameters**

- **scheme** (`str`): URI scheme the class handles, without `://`, such as `s3`.

**Raises**

- `ValueError`: Another class is already registered for `scheme`. Raised when the decorator is applied.
