Typings

These typed dictionaries describe cihai’s public configuration shape. They are useful when annotating code that builds or validates a cihai.types.ConfigDict.

Typings for cihai.

This is meant to be imported from inside typing.TYPE_CHECKING so it does not require typing_extensions at runtime:

>>> from typing import TYPE_CHECKING
>>> if TYPE_CHECKING:
...     from .types import DirsConfigDict
>>> def my_fn(dir_config: "DirsConfigDict") -> None:
...     pass
class cihai.types.RawPluginConfigDict
class cihai.types.RawPluginConfigDict

Bases: TypedDict

Barebones plugin config dictionary.

class cihai.types.RawDirsConfigDict
class cihai.types.RawDirsConfigDict

Bases: TypedDict

Raw directory config dictionary.

Values may be str templates holding XDG placeholders such as {user_cache_dir}, environment variables, or a tilde; cihai.config.expand_config() resolves them to pathlib.Path.

class cihai.types.DirsConfigDict
class cihai.types.DirsConfigDict

Bases: TypedDict

Directory config dictionary.

Resolved counterpart of RawDirsConfigDict: templates, environment variables, and tildes are already expanded.

class cihai.types.RawDatabaseConfigDict
class cihai.types.RawDatabaseConfigDict

Bases: TypedDict

Raw database config dictionary.

class cihai.types.RawConfigDict
class cihai.types.RawConfigDict

Bases: TypedDict

Raw, unresolved configuration dictionary.

Shape a caller passes to cihai.core.Cihai, before it is merged over cihai.constants.DEFAULT_CONFIG and its templates expanded.

class cihai.types.ConfigDict
class cihai.types.ConfigDict

Bases: TypedDict

Cihai Configuration dictionary.

Shape of cihai.core.Cihai.config: user input merged over cihai.constants.DEFAULT_CONFIG with templates expanded, so every key is present.