command-executor

Latest Version CI Status Coverage Status Documentation Status

Usage

Please refer to the Documentation to learn how to use command-executor. Basicly, command_executor provides some Python classes to make it easier to start processes / commands and handling errors and output. In addition, input validation for command parameters is possible.

Requirements

python-command-executor supports Python 3 only. No other dependencies are required.

Prepare for development

A Python 3 interpreter is required in addition to poetry.

$ poetry install

Now you’re ready to run the tests:

$ make tests

All Contents

Usage

Note

TODO: Add usage examples for command classes.

API Reference

Command

class command_executor.command.Command(**kwargs)[source]

Bases: object

process = None[source]
command = 'true'[source]
ignore_output = True[source]
fail_silently = False[source]
required_parameters = None[source]
stdout = -1[source]
stderr = -1[source]
execute(ignore_output=None, fail_silently=None, stdin=None, **kwargs)[source]
validate_parameters()[source]
get_parameters()[source]
get_command()[source]
handle_output(output)[source]
property pid[source]

Exceptions

exception command_executor.exceptions.CommandError[source]

Bases: Exception

exception command_executor.exceptions.CommandExecutionError(code, stderr, command)[source]

Bases: CommandError

exception command_executor.exceptions.CommandParameterError[source]

Bases: CommandError

Changelog

0.1.0 - 2019-01-10

  • Improved support for background / forking processes.

0.0.1 - 2018-08-08

  • Initial release of command-executor

Indices and tables