group_path = fs['/A/B'].parent.name
group_id = fd.require_group(group_path)
fs.copy('/A/B', group_id, name='G')
How to partially copy using python an Hdf5 file into a new one keeping the same structure?