# Timenet.config

## timenet.config

Load TimeNet settings from arguments and `TIMENET_*` environment variables.

Explicit values override environment variables, which override defaults.

### CACHE\_TAG `module-attribute`

```
CACHE_TAG = 'CACHEDIR.TAG'
```

The marker filename for cache folders created by TimeNet.

### TimeNetSettings

Bases: `BaseSettings`

TimeNet settings from arguments, `TIMENET_*` environment variables, and an optional `.env` file.

#### auto\_build `class-attribute` `instance-attribute`

```
auto_build: bool = True
```

Whether default sources include installed connectors (`TIMENET_AUTO_BUILD`).

#### cache `class-attribute` `instance-attribute`

```
cache: str = '~/.cache/timenet'
```

The cache directory for raw downloads and control databases (`TIMENET_CACHE`).

#### cache\_dir `property`

```
cache_dir: Path
```

The cache directory path with `~` expanded.

#### control\_cache\_dir `property`

```
control_cache_dir: Path
```

Where verified remote control databases are cached by checksum.

#### downloads\_dir `property`

```
downloads_dir: Path
```

The raw download cache directory, with a subdirectory for each dataset ID.

#### isolation `class-attribute` `instance-attribute`

```
isolation: Literal['on', 'off'] = 'on'
```

Whether a build runs in an environment built from the connector's requirements.

`"off"` runs it in the current interpreter. The isolated child sets this to `"off"` in its own
environment, which is what stops it re-execing forever.

#### local\_registry `class-attribute` `instance-attribute`

```
local_registry: str = '~/.timenet/registry'
```

The local registry path or `file://` URI (`TIMENET_LOCAL_REGISTRY`).

#### local\_registry\_dir `property`

```
local_registry_dir: Path
```

The local registry directory with `~` expanded.

Raises:

| Type | Description |
| --- | --- |
| `TimeNetRegistryError` | If the local registry path is blank, remote or uses an invalid URI. |

#### model\_config `class-attribute` `instance-attribute`

```
model_config = SettingsConfigDict(
    env_prefix="TIMENET_", env_file=".env", extra="ignore"
)
```

#### remote\_registry `class-attribute` `instance-attribute`

```
remote_registry: str = 'timenet://'
```

The registry after the local registry in the default sources (`TIMENET_REMOTE_REGISTRY`).

#### token `class-attribute` `instance-attribute`

```
token: str | None = None
```

Bearer token for a remote registry (`TIMENET_TOKEN`); `None` is anonymous.

### is\_cache\_folder

```
is_cache_folder(folder: Path) -> bool
```

Check a folder for TimeNet's `CACHEDIR.TAG` marker.

The check follows symlinks.

Parameters:

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `folder` | `Path` | The folder to check. | *required* |

Returns:

| Type | Description |
| --- | --- |
| `bool` | `True` if the marker's first two lines match TimeNet's cache tag. |

### make\_cache\_folder

```
make_cache_folder(folder: Path) -> None
```

Create a cache folder with TimeNet's `CACHEDIR.TAG` marker.

Existing folders stay unchanged.

Parameters:

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `folder` | `Path` | The cache folder to create along with any missing parents. | *required* |

### settings

```
settings(**overrides: Any) -> TimeNetSettings
```

Load and validate the TimeNet settings.

Overrides other than `None` take precedence over environment variables and defaults.

Parameters:

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `**overrides` | `Any` | Values by field name, with `None` values ignored. | `{}` |

Returns:

| Type | Description |
| --- | --- |
| `TimeNetSettings` | The validated settings. |

Raises:

| Type | Description |
| --- | --- |
| `TimeFValidationError` | If a value is invalid. |
