datalad x-export-bagit


datalad x-export-bagit [-h] [--archive {tar|tgz|bz2|zip}] [-d DATASET] [-r] [-R LEVELS] [--version] PATH


Export a dataset to a Bag-it

This is a proof-of-principle implementation that can export a DataLad dataset into a BagIt bag, a standardized storage and and transfer format for arbitrary digital content.




BagIt specification.


Export dataset to a bag directory at /tmp/bag:

% datalad x-export-bagit /tmp/bag

Export dataset to a ZIP archive bag at /tmp/

% datalad x-export-bagit --archive zip /tmp/bag



location to export to. With --archive this is the base path, and a filename extension will be appended to it. Constraints: value must be a string

-h, --help, --help-np

show this help message. --help-np forcefully disables the use of a pager for displaying the help message

--archive {tar|tgz|bz2|zip}

export bag as a single-file archive in the given format. Constraints: value must be one of ('tar', 'tgz', 'bz2', 'zip')

-d DATASET, --dataset DATASET

specify the dataset to export. Constraints: Value must be a Dataset or a valid identifier of a Dataset (e.g. a path)

-r, --recursive

if set, recurse into potential subdataset.

-R LEVELS, --recursion-limit LEVELS

limit recursion into subdataset to the given number of levels. Constraints: value must be convertible to type 'int'


show the module and its version which provides the command


datalad is developed by Michael Hanke <>.