stubber.utils.typed_config_toml

typed-config-toml

Extend typed-config to read configuration from .toml files

Module Contents

Classes

TomlConfigSource

Read configuration from a .toml file

class stubber.utils.typed_config_toml.TomlConfigSource(filename: str, prefix: str | None = None, must_exist: bool = True)

Bases: typedconfig.source.ConfigSource

Read configuration from a .toml file

prefix is used to allow for toml nested configuration a common prefix = “tool.”

` #pyproject.toml [tool.deadparrot] species = "Norwegian Blue" state = "resting" details = ["pinging","Lovely plumage","3"] ` Use the below code to retrieve: ` # TODO sample code `

Parameters:
  • filename (str) –

  • prefix (Optional[str]) –

  • must_exist (bool) –

get_config_value(section_name: str, key_name: str) str | None
Parameters:
  • section_name (str) –

  • key_name (str) –

Return type:

Optional[str]