here is a sample code you can try:
transport = paramiko.Transport((host, port))
transport.connect(None, username, password)
sftp_path =sftp_path + sftp_file_name
sftp = paramiko.SFTPClient.from_transport(transport)
sftp.get(sftp_path, replaced_local_path + flat_file_name)
please ensure the all the variables are correctly defined and the connection to the host server is open.