"""Utility class DotDict.""" class DotDict(dict): """A wrapper around dict to access its items using dot notation.""" def __getattr__(self, item): """Get item from dictionary by it's key, using dot-notation. Args: item (str): key Returns: value, or None if there is no item with such key """ return self.get(item) def __setattr__(self, key, value): """Set value in dictionary, using dot-notation. Args: key (str): item key value: item value """ self[key] = value