Skip to content

Add EnvYAML Support and Config Accessors#41

Merged
PenguinBoi12 merged 2 commits intomainfrom
config-envvar
Apr 12, 2026
Merged

Add EnvYAML Support and Config Accessors#41
PenguinBoi12 merged 2 commits intomainfrom
config-envvar

Conversation

@PenguinBoi12
Copy link
Copy Markdown
Contributor

Replaces yaml.safe_load with EnvYAML in load_from_file to support environment variable substitution in config files using ${VAR} syntax.

Also adds get() and __getitem__() methods to Config to allow structured access to config values beyond the standard Matrix connection fields, including support for custom sections.

Changes:

  • Swap yaml.safe_load for EnvYAML in load_from_file
  • Store raw config data in self._data for downstream access
  • Add get(self, key: str, *, section: str | None = None, default: Any = None) for optional lookups
  • Add __getitem__ for required lookups with KeyError on missing keys

@PenguinBoi12 PenguinBoi12 merged commit 9d2b531 into main Apr 12, 2026
4 checks passed
@PenguinBoi12 PenguinBoi12 deleted the config-envvar branch April 12, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants