import zarr
zarr.__version__
g1 = zarr.group()
g2 = g1.create_group('foo')
g3 = g1.create_group('bar')
g3.create_group('baz')
g3.create_dataset('xxx', shape=100)
g3.create_dataset('yyy', shape=(100, 100), dtype='i4')
g5 = g3.create_group('quux')
g5.create_dataset('aaa', shape=100)
g5.create_dataset('bbb', shape=(100, 100), dtype='i4')
g7 = g3.create_group('zoo')
Generate text (unicode) tree:
print(g1.tree())
The level
parameter controls how deep the tree is.
print(g1.tree(level=1))
print(g1.tree(level=2))
Alternative plain ASCII tree:
print(bytes(g1.tree()).decode())
HTML trees:
g1.tree()
Use expand=True
to have all groups automatically expanded.
g1.tree(expand=True)
g1.tree(expand=True, level=2)
g1.tree(expand=True, level=1)
The expand
parameter can also be an integer, giving the depth to expand to.
g1.tree(expand=1)
g1.tree(expand=2)
g1.tree(expand=3)