Reference
Public API documentation.
Utilities
- class open_api_framework.conf.utils.EnvironmentVariable(name: str, default: Any, help_text: str, group: str | None = None, auto_display_default: bool = True)
- open_api_framework.conf.utils.config(option: str, default: _T = <decouple.Undefined object>, help_text='', group=None, add_to_docs: str | bool = True, auto_display_default=True, *args, **kwargs) _T
An override of
decouple.config, with custom options to construct documentation for environment variables.Pull a config parameter from the environment.
Read the config variable
option. If it’s optional, use thedefaultvalue. Input is automatically cast to the correct type, where the type is derived from the default value if possible.Pass
split=Trueto split the comma-separated input into a list.Additionally, the variable is added to a registry that is used to construct documentation via the
generate_envvar_docsmanagement command. The following arguments are added for this:- Parameters:
help_text – The help text to be displayed for this variable in the documentation. Default “”
group – The name of the section under which this variable will be grouped. Default
Noneadd_to_docs – Whether or not this variable will be displayed in the documentation. Default
TrueIf a string is passed, it will only be displayed if it is importable as a module, and will raise a Warning when it is still passed in from the environment.auto_display_default – Whether or not the passed
defaultvalue is displayed in the docs, this can be set toFalsein case a default needs more explanation that can be added to thehelp_text(e.g. if it is computed or based on another variable). DefaultTrue
- open_api_framework.conf.utils.get_sentry_integrations() list[Integration]
Determine which Sentry SDK integrations to enable.
- open_api_framework.conf.utils.importable(*items: str) list[str]
Return the dotted paths that start from an installed package
- open_api_framework.conf.utils.mute_logging(config: dict) None
Disable (console) output from logging. :arg config: The logging config, typically the django LOGGING setting.