# Discovery

## timenet\_connectors.discovery

Lazy, convention-based connector discovery.

Each connector lives in its own folder at `datasets/<org>/<name>/` (or `datasets/<name>/` for a
flat id): the package's `__init__.py` exposes a `CONNECTOR` class and a `dataset.yaml` card sits
beside it. A dataset id maps to that package by convention, so there is no central registry to maintain
and only the requested connector is imported. Each connector declares its own id via `metadata()`.

### available

```
available() -> list[str]
```

List the dataset ids of every discoverable connector.

Imports each connector module (used for listings and error messages, not the build hot path).

Returns:

| Type | Description |
| --- | --- |
| `list[str]` | The declared dataset ids, sorted. |

### resolve

```
resolve(dataset_id: str) -> type[BaseConnector]
```

Return the connector class for a dataset id, importing only its module.

Parameters:

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `dataset_id` | `str` | A flat (`hello_world`) or `org/name` (`chengsenwang/tsqa`) id. | *required* |

Returns:

| Type | Description |
| --- | --- |
| `type[BaseConnector]` | The connector class. |

Raises:

| Type | Description |
| --- | --- |
| `LookupError` | If no module exists for the id, or it exposes no `CONNECTOR`. |
