# Collections
# DotDict
A dict
that also supports attribute ("dot") access. Think of this as an extension to the standard python dict
object. Note: while any hashable object can be added to a DotDict
, only valid Python identifiers can be accessed with the dot syntax; this excludes strings which begin in numbers, special characters, or double underscores.
Args:
init_dict (dict, optional)
: dictionary to initialize theDotDict
with**kwargs (optional)
: key, value pairs with which to initialize theDotDict
dotdict = DotDict({'a': 34}, b=56, c=set())
dotdict.a # 34
dotdict['b'] # 56
dotdict.c # set()
methods: |
---|
prefect.utilities.collections.DotDict.copy ()[source] |
Creates and returns a shallow copy of the current DotDict |
prefect.utilities.collections.DotDict.get (key, default=None)[source] |
This method is defined for MyPy, which otherwise tries to type the inherited
|
prefect.utilities.collections.DotDict.to_dict ()[source] |
Converts current |
# Functions
top-level functions: |
---|
prefect.utilities.collections.merge_dicts (d1, d2)[source] |
Updates
|
prefect.utilities.collections.as_nested_dict (obj, dct_class=<class 'prefect.utilities.collections.DotDict'>)[source] |
Given a obj formatted as a dictionary, transforms it (and any nested dictionaries) into the provided dct_class
|
prefect.utilities.collections.dict_to_flatdict (dct, parent=None)[source] |
Converts a (nested) dictionary to a flattened representation.
|
prefect.utilities.collections.flatdict_to_dict (dct, dct_class=None)[source] |
Converts a flattened dictionary back to a nested dictionary.
|
This documentation was auto-generated from commit bd9182e
on July 31, 2024 at 18:02 UTC