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:
TypedDictBarebones plugin config dictionary.
-
class cihai.types.RawDirsConfigDict¶class cihai.types.RawDirsConfigDict¶
Bases:
TypedDictRaw directory config dictionary.
Values may be
strtemplates holding XDG placeholders such as{user_cache_dir}, environment variables, or a tilde;cihai.config.expand_config()resolves them topathlib.Path.
-
class cihai.types.DirsConfigDict¶class cihai.types.DirsConfigDict¶
Bases:
TypedDictDirectory config dictionary.
Resolved counterpart of
RawDirsConfigDict: templates, environment variables, and tildes are already expanded.
-
class cihai.types.RawDatabaseConfigDict¶class cihai.types.RawDatabaseConfigDict¶
Bases:
TypedDictRaw database config dictionary.
-
class cihai.types.RawConfigDict¶class cihai.types.RawConfigDict¶
Bases:
TypedDictRaw, unresolved configuration dictionary.
Shape a caller passes to
cihai.core.Cihai, before it is merged overcihai.constants.DEFAULT_CONFIGand its templates expanded.
-
class cihai.types.ConfigDict¶class cihai.types.ConfigDict¶
Bases:
TypedDictCihai Configuration dictionary.
Shape of
cihai.core.Cihai.config: user input merged overcihai.constants.DEFAULT_CONFIGwith templates expanded, so every key is present.