export a dataset as a TAR/ZIP archive to figshare

class datalad.plugin.export_to_figshare.ExportToFigshare[source]

Bases: datalad.interface.base.Interface

Export the content of a dataset as a ZIP archive to figshare

Very quick and dirty approach. Ideally figshare should be supported as a proper git annex special remote. Unfortunately, figshare does not support having directories, and can store only a flat list of files. That makes it impossible for any sensible publishing of complete datasets.

The only workaround is to publish dataset as a zip-ball, where the entire content is wrapped into a .zip archive for which figshare would provide a navigator.

class EnsureDataset


class EnsureInt


Ensure that an input (or several inputs) are of a data type ‘int’.

class EnsureNone


Ensure an input is of value None

class EnsureStr(min_len=0)


Ensure an input is a string.

No automatic conversion is attempted.

class Parameter(constraints=None, doc=None, args=None, **kwargs)

Bases: object

This class shall serve as a representation of a parameter.

get_autodoc(name, indent=' ', width=70, default=None, has_default=False)

Docstring for the parameter to be used in lists of parameters

Return type:string or list of strings (if indent is None)
datasetmethod(name=None, dataset_argname='dataset')

Decorator for return value evaluation of datalad commands.

Note, this decorator is only compatible with commands that return status dict sequences!

Two basic modes of operation are supported: 1) “generator mode” that yields individual results, and 2) “list mode” that returns a sequence of results. The behavior can be selected via the kwarg return_type. Default is “list mode”.

This decorator implements common functionality for result rendering/output, error detection/handling, and logging.

Result rendering/output can be triggered via the datalad.api.result-renderer configuration variable, or the result_renderer keyword argument of each decorated command. Supported modes are: ‘default’ (one line per result with action, status, path, and an optional message); ‘json’ (one object per result, like git-annex), ‘json_pp’ (like ‘json’, but pretty-printed spanning multiple lines), ‘tailored’ custom output formatting provided by each command class (if any).

Error detection works by inspecting the status item of all result dictionaries. Any occurrence of a status other than ‘ok’ or ‘notneeded’ will cause an IncompleteResultsError exception to be raised that carries the failed actions’ status dictionaries in its failed attribute.

Status messages will be logged automatically, by default the following association of result status and log channel will be used: ‘ok’ (debug), ‘notneeded’ (debug), ‘impossible’ (warning), ‘error’ (error). Logger instances included in the results are used to capture the origin of a status report.

Parameters:func (function) – __call__ method of a subclass of Interface, i.e. a datalad command definition
class datalad.plugin.export_to_figshare.FigshareRESTLaison[source]

Bases: object

A little helper to provide minimal interface to interact with Figshare

API_URL = ''
get(*args, **kwargs)[source]
post(*args, **kwargs)[source]
put(*args, **kwargs)[source]
upload_file(fname, files_url)[source]