datalad_core.runners

Execution of subprocesses

This module provides all relevant components for subprocess execution. The main work horse is iter_subproc(), a context manager that enables interaction with a subprocess in the form of an iterable for input/output processing. Execution errors are communicated with the CommandError exception. In addition, a few convenience functions are provided to execute Git commands (including git-annex).

call_git(args, *[, cwd, env, ...])

Call Git with no output capture, raises on non-zero exit.

call_git_lines(args, *[, cwd, inputs, env, ...])

Call Git for any (small) number of lines of output

call_git_oneline(args, *[, cwd, inputs, ...])

Call Git for a single line of output

call_git_success(args, *[, cwd, ...])

Call Git and report success or failure of the command

call_annex_json_lines(annex_args, *[, ...])

Runs a git-annex command and yields JSON-based results

iter_subproc(args, *[, inputs, chunk_size, ...])

Context manager to communicate with a subprocess using iterables

iter_git_subproc(args, *[, inputs, ...])

Context manager to communicate with a subprocess using iterables

iter_git_subproc_zlines(args, *[, inputs, ...])

Context manager to communicate with a subprocess using iterables

CommandError(cmd[, msg, returncode, stdout, ...])

Raised when a subprocess execution fails (non-zero exit)