from contextlib import closing
from fabric.network import connect
with closing(connect(user, host, port)) as ssh:
    with closing(ssh.open_sftp()) as sftp:
        with closing(sftp.open('remote_filename')) as file:
            for line in file:
                process(line)
Прочитайте файл с сервера с помощью ssh, используя python