Core Class & Methods¶
Toolrunner Functions¶
Static functions, independent of Tools instances.
- toolrunner.run(args, new_proc: bool = False, **kwargs)¶
Wrapper for subprocess.run/Popen
- toolrunner.get_argv(index: int)¶
Retrieve argument(filepath) from argv[index]
Tools Class¶
- toolrunner.Tools(target: str = None, output_dir: str = None, config: dict = dict(), verbose: bool = True)¶
Class for collecting tool configurations and spawning their processes
Tools Methods¶
Additional keyword arguments (kwargs) are passed to subprocess.run() or subprocess.Popen(), for your tweaking convenience.
When calling any of the run commands, setting output=False will cause the results to be printed to the console instead of being written to a file. Setting output=True on gui tools will just create an empty file name.txt file.
Command-line Interface Tools - cli¶
Executables, tools, CMD/Shell commands, etc.
Default: Target file appended to the end of the command arguments, results output to name.txt, spawned as a child process.
- toolrunner.Tools.cli(name: str, path: str, args: list = [])¶
Add CLI tool to Tools dictionary
- toolrunner.Tools.run_cli(input_target: bool = True, output: bool = True, new_proc: bool = False, **kwargs)¶
Run all CLI-type tools
Graphical User Interface Tools - gui¶
Default: Target file appended to the end of the command arguments, no output produced, spawned in its own independent process.
- toolrunner.Tools.gui(name: str, path: str, args: list = [])¶
Add GUI tool to Tools dictionary
- toolrunner.Tools.run_gui(input_target: bool = True, output: bool = False, new_proc: bool = True, **kwargs)¶
Run all GUI-type tools
Run All¶
- toolrunner.Tools.run_all(**kwargs)¶
Run all gui and cli tools
Get Configuration Dictionary¶
Prints the instance’s current tool configuration, so that it may be copy and pasted. Loading the tools via a dictionary is cleaner and allows for differenct configurations to be managed more easily.
- toolrunner.Tools.print_config()¶
Print Tools dictionary in copy/pastable format