Shell-scripter is still a work-in-progress. API may change at any time.
Shell-scripter is on the Python Package Index and can be installed with pip install shell-scripter
from shell_scripter import run
run("cat", "logfile").pipe("grep", "error")().show()