Created
June 2, 2020 12:00
-
-
Save chr5tphr/429b75fa07f46c3b3b9beb254c0e858f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import h5py | |
import click | |
@click.command() | |
@click.argument('sources', nargs=-1, type=click.Path(exists=True, dir_okay=False)) | |
@click.argument('destination', type=click.Path(dir_okay=False, writable=True)) | |
def main(sources, destination): | |
outfd = h5py.File(destination, 'a') | |
for src in sources: | |
with h5py.File(src, 'r') as srcfd: | |
for key in list(srcfd): | |
h5py.h5o.copy(srcfd.id, key.encode('ascii'), outfd.id, key.encode('ascii')) | |
outfd.close() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment