Skip to content

The 'tree' command with markers for DataLad datasets

License

Notifications You must be signed in to change notification settings

catetrai/tree-datalad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tree-datalad

tests

A wrapper for the UNIX tree command with added markers for DataLad datasets. Helps visualize hierarchies of nested subdatasets and describe dataset layouts.


💡 Note: there is now a native datalad tree command, available in the datalad-next extension (>=v0.6.0). See documentation.


Usage

tree-datalad works just like tree. You can pass it any tree options.

Examples

View a hierarchy of nested subdatasets in the context of the whole directory layout:

❯ tree-datalad -d -L 3 bids
bids  <--[DS]
├── code
│   └── common
├── data
│   ├── inputs
│   │   └── dicom  <--[DS]
│   └── outputs
│       ├── sub-01
│       └── sub-02
└── environments  <--[DS]
    ├── images

Find datasets at all depths starting from the current directory:

❯ tree-datalad -d -f | grep '\[DS\]'
├── ./bids  <--[DS]
│   │   │   └── ./bids/data/inputs/dicom  <--[DS]
│   ├── ./bids/environments  <--[DS]
└── ./dicom  <--[DS]

Requirements

  • bash (Linux or macOS)
  • tree >= v1.6.0-1
  • datalad

Installation

Copy the shell script tree-datalad to a directory in your $PATH, such as $HOME/bin or /usr/local/bin.