When creating tool for system administration tasks, we often have the need to execute some other command-line programs, execute some commands on remote machine, transferring data between local and remote machine via SSH. A straightforward thinking will be to implement the tool in shell. But what if you, like me, hate the syntax of shell and be happier with Python? And especially when you want to challenge yourself with the new (somehow) cool asyncio?
To have a clear picture, let's give an example that you want to implement a command like this:
ssh remote-server "pg_dump -O webdata | gzip" | gunzip | psql localdb