Wrapping and combining CLI applications
One common kind of automation involves running several programs, none of which are Python applications. Since the programs aren't written in Python, it's impossible to refactor each program to create a composite Python application. When using a non-Python application, we can't follow the Combining two applications into one recipe shown earlier in this chapter.
Instead of aggregating the Python components, an alternative is to wrap the other programs in Python, creating a composite application. The use case is very similar to the use case for writing a shell script. The difference is that Python is used instead of a shell language. Using Python has some advantages:
- Python has a rich collection of data structures. Most shell languages are limited to strings and arrays of strings.
- Python has several outstanding unit test frameworks. Rigorous unit testing gives us confidence that the combined application...