dynaconf.utils package¶
Submodules¶
dynaconf.utils.boxing module¶
dynaconf.utils.functional module¶
dynaconf.utils.parse_conf module¶
-
class
dynaconf.utils.parse_conf.Del(value)[source]¶ Bases:
dynaconf.utils.parse_conf.MetaValueTriggers an existing key to be deleted
-
dynaconf_del= True¶
-
-
class
dynaconf.utils.parse_conf.LazyFormat(value, formatter=<method 'format' of 'str' objects>)[source]¶ Bases:
objectHolds data to format lazily.
-
context¶ Builds a context for formatting.
-
dynaconf_lazy_format= True¶
-
-
class
dynaconf.utils.parse_conf.Merge(value)[source]¶ Bases:
dynaconf.utils.parse_conf.MetaValueTriggers an existing key to be merged
-
dynaconf_merge= True¶
-
-
class
dynaconf.utils.parse_conf.MetaValue(value)[source]¶ Bases:
objectA Marker to trigger specific actions on set and object_merge
-
meta_value= True¶
-
-
class
dynaconf.utils.parse_conf.Reset(value)[source]¶ Bases:
dynaconf.utils.parse_conf.MetaValueTriggers an existing key to be reset to its value
-
dynaconf_reset= True¶
-
dynaconf.utils.files module¶
-
dynaconf.utils.files.find_file(filename='.env', project_root=None, skip_files=None, **kwargs)[source]¶ Search in increasingly higher folders for the given file Returns path to the file if found, or an empty string otherwise.
This function will build a search_tree based on:
- Project_root if specified
- Invoked script location and its parents until root
- Current working directory
For each path in the search_tree it will also look for an aditional ./config folder.
Module contents¶
-
class
dynaconf.utils.DynaconfDict(*args, **kwargs)[source]¶ Bases:
dictA dict representing en empty Dynaconf object useful to run loaders in to a dict for testing
-
logger¶
-
-
class
dynaconf.utils.Missing[source]¶ Bases:
objectSentinel value object/singleton used to differentiate between ambiguous situations where None is a valid value.
-
dynaconf.utils.build_env_list(obj, env)[source]¶ Build env list for loaders to iterate.
- Arguments:
- obj {LazySettings} – A Dynaconf settings instance env {str} – The current env to be loaded
- Returns:
- [str] – A list of string names of the envs to load.
-
dynaconf.utils.compat_kwargs(kwargs)[source]¶ To keep backwards compat change the kwargs to new names
-
dynaconf.utils.deduplicate(list_object)[source]¶ Rebuild list_object removing duplicated and keeping order
-
dynaconf.utils.object_merge(old, new, unique=False)[source]¶ Recursively merge two data structures.
Parameters: unique – When set to True existing list items are not set.
-
dynaconf.utils.trimmed_split(s, seps=(';', ', '))[source]¶ Given a string s, split is by one of one of the seps.
-
dynaconf.utils.upperfy(key)[source]¶ Receive a string key and returns its upper version.
Example:
input: foo output: FOO
input: foo_bar output: FOO_BAR
input: foo__bar__ZAZ output: FOO__bar__ZAZ
- Arguments:
- key {str} – A string key that may contain dunders __
- Returns:
- The key as upper case but keeping the nested elements.