def METHOD_NAME(dtstr):
    """
    the 'datatype' attribute is specific to LEGEND HDF5 files.
    reference: http://legend-exp.org/legend-data-format-specs/dev/
    right now, this fills an output dict by string splitting.
    there is probably a better way to read the Julia-formatted string.
    also, think about changing enums to numpy named tuples for faster lookups.
    """
    dt = {}
    # TODO: oliver gave me these, we should update the function below
    # to use them instead of all that messy string splitting
    # datatype_regexp = r"""^(([A-Za-z_]*)(<([0-9,]*)>)?)(\{(.*)\})?$"""
    # arraydims_regexp = r"""^<([0-9,]*)>$"""
    sp1 = dtstr.split("{")[0]
    dt["format"] = sp1 # scalar, array, struct, or table
    if "array" in dt["format"]:
        dt["ndim"] = int(sp1.split("<")[1].split(">")[0])
    sp2 = dtstr.split("{")[1:]
    if "enum" in sp2:
        dt["dtype"] = "enum"
        sp3 = sp2[1].split(",")
        for tmp in sp3:
            tmp = tmp.rstrip("}").split("=")
            dt[int(tmp[1])] = tmp[0]
    else:
        dt["dtype"] = sp2[0].rstrip("}")
    # pprint(dt)
    return dt