#!/usr/bin/env python # coding: utf-8 # In[1]: import zarr zarr.__version__ # In[2]: 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: # In[3]: print(g1.tree()) # The ``level`` parameter controls how deep the tree is. # In[4]: print(g1.tree(level=1)) # In[5]: print(g1.tree(level=2)) # Alternative plain ASCII tree: # In[6]: print(bytes(g1.tree()).decode()) # HTML trees: # In[7]: g1.tree() # Use ``expand=True`` to have all groups automatically expanded. # In[8]: g1.tree(expand=True) # In[9]: g1.tree(expand=True, level=2) # In[10]: g1.tree(expand=True, level=1) # The ``expand`` parameter can also be an integer, giving the depth to expand to. # In[11]: g1.tree(expand=1) # In[12]: g1.tree(expand=2) # In[13]: g1.tree(expand=3) # In[ ]: