def METHOD_NAME(fname, max_meta_num=200):
    # generate string
    global h5_str, maxDigit
    h5_str = ''
    def hdf5_structure2string(name, obj):
        global h5_str, maxDigit
        if isinstance(obj, h5py.Group):
            h5_str += f'HDF5 group   "/{name}"\n'
        elif isinstance(obj, h5py.Dataset):
            h5_str += f'HDF5 dataset "/{name:<{maxDigit}}": shape={str(obj.shape):<20}, '
            h5_str += f'dtype={str(obj.dtype):<10}, compression={obj.compression}\n'
        atr = dict(obj.attrs)
        if len(atr) > 0:
            h5_str += attributes2string(atr, max_meta_num=max_meta_num)
    with h5py.File(fname, 'r') as f:
        # grab metadata in root level as it will be missed in hdf5_structure2string()
        atr = dict(f.attrs)
        if len(atr) > 0:
            h5_str += 'Attributes in / level:\n'
            h5_str += attributes2string(atr, max_meta_num=max_meta_num)+'\n'
        # get maxDigit value
        maxDigit = max(len(i) for i in f.keys())
        maxDigit = max(20, maxDigit+1)
        if atr.get('FILE_TYPE', 'timeseries') == 'HDFEOS':
            maxDigit += 35
        # get structure string
        f.visititems(hdf5_structure2string)
    # print string
    print(h5_str)
    return h5_str