Over the last few months, I've frequently needed to use SSH from Python, but
didn't find any of the existing solutions to be well-suited for what I needed
(see below for discussion of other solutions). So, I've created
spur.py to
make using SSH from Python easy. For instance, to run echo over
SSH:

shell.run() executes a command, and returns the result once it's
finished executing. If you don't want to wait until the command has finished,
you can call shell.spawn() instead, which returns a process object:

spur.py is certainly not the only way to use SSH from Python, and it's
possible that one of the other solutions might be better suited for what you
need. I've come across three other main alternatives.

The first is to shell out to ssh. It works, but it's ugly.

The second is to use Fabric. Unfortunately,
I found Fabric to be a bit too high-level. It's useful for implementing
deployment scripts using SSH, but I found it awkward to use as a general-purpose
library for SSH.

Finally, there's paramiko.
I found paramiko to be a bit too low-level, but both Fabric and spur.py
are built on top of paramiko.