def METHOD_NAME(self, key):
    """Get BUFR attributes."""
    # This function is inefficient as it is looping through the entire
    # file to get 1 attribute. It causes a problem though if you break
    # from the file early - dont know why but investigating - fix later
    fh = open(self.filename, "rb")
    while True:
        # get handle for message
        bufr = ec.codes_bufr_new_from_file(fh)
        if bufr is None:
            break
        ec.codes_set(bufr, 'unpack', 1)
        attr = ec.codes_get(bufr, key)
        ec.codes_release(bufr)
    fh.close()
    return attr