def METHOD_NAME(self, tag):
    data = {}
    # get tag metadata attribute
    tag_data = tag.metadata()
    # convert tag metadata to normal keys names and values to correct types
    for k, v in dict(tag_data).items():
        key = k.replace("tag.", "")
        try:
            # capture exceptions which are related to strings only
            if re.match(r"^[\d]+$", v):
                value = int(v)
            elif re.match(r"^True$", v):
                value = True
            elif re.match(r"^False$", v):
                value = False
            elif re.match(r"^None$", v):
                value = None
            elif re.match(r"^[\w\d_]+$", v):
                value = v
            else:
                value = ast.literal_eval(v)
        except (ValueError, SyntaxError):
            value = v
        data[key] = value
    return data