anyconfig.backend.yaml.common

Common library for YAML backend modules.

anyconfig.backend.yaml.common.filter_from_options(key, options)

Filter a key key in ``options.

Parameters:
  • key (str) – Key str in options

  • options (dict[str, Any]) – Mapping object

Return type:

dict[str, Any]

Returns:

New mapping object from ‘options’ in which the item with ‘key’ filtered

>>> filter_from_options("a", dict(a=1, b=2))
{'b': 2}
class anyconfig.backend.yaml.common.Parser

Bases: StreamParser

Parser for YAML files.

_type: ClassVar[str] = 'yaml'
_extensions: tuple[str, ...] = ('yaml', 'yml')
_ordered: ClassVar[bool] = True
_allow_primitives: ClassVar[bool] = True
_dict_opts: tuple[str, ...] = ('ac_dict',)
__annotations__ = {'_allow_primitives': 'typing.ClassVar[bool]', '_cid': 'typing.ClassVar[str]', '_dict_opts': 'tuple[str, ...]', '_dump_opts': 'tuple[str, ...]', '_extensions': 'tuple[str, ...]', '_load_opts': 'tuple[str, ...]', '_open_read_mode': 'typing.ClassVar[str]', '_open_write_mode': 'typing.ClassVar[str]', '_ordered': 'typing.ClassVar[bool]', '_priority': 'typing.ClassVar[int]', '_type': 'typing.ClassVar[str]'}
__module__ = 'anyconfig.backend.yaml.common'