segram.utils.settings module

Utilities for managing package options.

class segram.utils.settings.Settings(**kwds: Any)[source]

Bases: Namespace

Settings manager for handling multiple option sets.

It support with statement, which allow setting temporary values to any option group. If default attribute is defined, it is used as a defult key when using get() without arguments.

get(key: str | None = None, default: Any = None, /) Any[source]

Get option value or a default.

Instance attribute self.__default__ is used instead of key when key=None.