monkey_wrench.cli package
The package providing functionalities needed for invoking Monkey Wrench from the CLI (task runner mode).
- class monkey_wrench.cli.CommandLineArguments[source]
Bases:
ModelPydantic model to validate CLI arguments.
It reads the CLI arguments from sys.argv, where
sys.argv[0]is the path of the script which is being executed, i.e.monkey-wrenchin this case. As a result, the actual arguments aresys.argv[1:].- classmethod validate_number_of_inputs(data: Any) Any[source]
Ensure that the number of input arguments is correct.
- classmethod validate_task_filepath_existence(data: Any) Any[source]
Check that the task file exists and assign it to the class variable.
- task_file_path: ensure_path_does_not_end_with_slash)]]
The path to the task file, which must be an existing valid YAML file.
- monkey_wrench.cli.run() None[source]
The main entrypoint, when Monkey Wrench is invoked from the CLI.
It uses the task file which has been provided via the CLI. It then goes through each task, parses it, and performs it. The order at which the tasks run, matches their order in the task file.
Example
Running Monkey Wrench in the task runner mode# The task file must be a valid YAML file. $ monkey-wrench <task_file_path>