> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validio.io/llms.txt
> Use this file to discover all available pages before exploring further.

# validio_sdk.config module

> Persistent configuration.

Persistent configuration.

### Config

```python
class validio_sdk.config.Config(config_dir: Path | None = None)
```

**Parameters**

**config\_dir** `Path | None`

Bases: `object`

Config management.

A class to work with configuration such as reading, writing and deleting.

#### exists()

```python
exists() → bool
```

**Returns:** `bool`

Check if any configuration exist.

#### read()

```python
read() → ValidioConfig
```

**Returns:** `ValidioConfig`

Read persistent configuration.

Will return None if no configuration is created yet.

* Returns:

  The configuration, or None

* Return type:

  [ValidioConfig](https://docs.validio.io/v11.1/sdk-reference/validio_sdk.md#validioconfig "validio_sdk.config.ValidioConfig") | None

* Raises:

  ConfigNotFoundError if no configuration exists

* Raises:

  ConfigNotFoundError if the configuration is invalid

#### remove()

```python
remove() → None
```

**Returns:** `None`

Remove the configuration at the instance’s config\_path.

#### write()

```python
write(config: ValidioConfig) → None
```

**Parameters**

**config** `ValidioConfig` *required*

**Returns:** `None`

Write the passed configuration to disk.

This will fully overwrite the existing configuration, including any fields that’s not a part of the ValidioConfig.

* Parameters:

  **config** – A ValidioConfig object.

### ValidioConfig

```python
class validio_sdk.config.ValidioConfig(endpoint: str = '', access_key: str = '', access_secret: str = '', default_namespace: str = 'default')
```

**Parameters**

**endpoint** `str`

**access\_key** `str`

**access\_secret** `str`

**default\_namespace** `str`

Bases: `object`

Representation of configuration to use in the Validio system and SDK.

#### access\_secret

```python
property access_secret: str
```

#### asdict()

```python
asdict() → dict[str, str]
```

**Returns:** `dict[str, str]`

Return a dictionary representation of the class.

This is used from our ClassJSONEncoder to ensure we save JSON representing the class with the external property names. By doing this we can also ensure that we can serialize the config by passing the JSON to the constructor.

### default\_config\_dir()

```python
validio_sdk.config.default_config_dir() → Path
```

**Returns:** `Path`

Get the default config dir based on the OS.
