code: def str2dict(dotted_str, value=None, separator='.'):
      
      dict_ = {}
      parts = dotted_str.split(separator)
      d, prev = dict_, None
      for part in parts:
          prev = d
          d = d.setdefault(part, {})
      else:
          if value is not None:
              prev[part] = value
      return dict_
docs: Convert dotted string to dict splitting by :separator: