datalad_core.commands
Components for implementing DataLad commands
At the very core, a DataLad command is function that documents and validates its parameters in a particular way, and yields return values that follow particular conventions.
In its simplest form, a DataLad command can be created like this:
>>> @datalad_command()
... def my_command(some_arg):
... # do processing ...
... return # typically one or more results are returned/yielded
The datalad_command() decorator wraps a function, and automatically
establishes the conventions expected for a DataLad command (see its
documentation for details).
Beyond this simplest use, the decorator can be used to customize parameter validation, and result handling. Both aspects are handled by customizable classes.
|
Wrap a callable with parameter preprocessing and result post-processing |
|
Abstract base class for result handlers |
|
Result handler commonly used by commands |
|
Minimal handler that relays any return value unmodified |
Get the default result handler class used by |
|
|
Set a default result handler class for use by |
|
Dataset parameter type for DataLad command implementations |
|
Ensure an absent/present Dataset from any path or Dataset instance |
Abstract base class for parameter processors |
|
|
Parameter preprocessor with support for multi-parameter set handling |
|
Representation of a parameter constraint context |
|
Exception for command parameter constraint violations |
|
Base class for constraints of command parameter sets |