Questions tagged [pysftp]

pysftp is a thin wrapper over paramiko's SFTPClient.

pysftp is a thin wrapper over 's SFTPClient.

372 questions
4
votes
0 answers

pysftp paramiko.ssh_exception.SSHException: unpack requires a buffer of 4 bytes

I am using pysftp for the first time. I have seen this error before with struct and other libraries, but the problem with pysftp seems tricky. I can't connect to the server. I am sure I am missing something basic here, and so any ideas will be…
RforResearch
  • 401
  • 8
  • 16
4
votes
3 answers

Using pysftp to split text file in SFTP directory

I'm trying to split text file of size 100 MB (having unique rows) into 10 files of equal size using python pysftp but I'm unable to find proper approach for same. Please let me know how can I read/ split files from SFTP directory and place back all…
mu shaikh
  • 83
  • 6
4
votes
1 answer

pysftp putfo creates an empty file on SFTP server but not streaming the content from StringIO

My code first writes lines to a CSV in io.StringIO(): fileBuffer = io.StringIO() # write header header_writer = csv.DictWriter(fileBuffer, fieldnames=columnNames) header_writer.writeheader() # write lines writer = csv.writer(fileBuffer,…
C.Tomas
  • 451
  • 2
  • 7
  • 15
4
votes
0 answers

Server connection dropped while downloading large files(600Mb)from sftp using pysftp library in python

I have a python script which downloads some files from sftp server. But getting server connection dropped error after some time. ++++Error+++ File "/home/user/venv/lib/python3.6/site-packages/paramiko/sftp.py", line 188, in _read_all raise…
GKotkar
  • 47
  • 1
  • 3
4
votes
2 answers

How can I move files from a local file server (SFTP) directly into Snowflake?

I am looking to move files from a couple of file servers (accessed via SFTP) into Snowflake directly using the Python Snowflake connector. I have considered using Data Factory (ADF) to pull the files into blob storage and then to create an Azure…
4
votes
3 answers

"No hostkey for ... found" in pysftp code even though cnopts.hostkeys is set to None

Background To SFTP across to another server I use the following command in the UNIX command line: sftp -i /some_dir/another_dir/key -oPort=12345 user@12.123.456.789 What I want to achieve I want to convert this to command to be used with…
3kstc
  • 1,871
  • 3
  • 29
  • 53
4
votes
1 answer

pysftp- How to get the sftp server upload timestamp?

I've been trying to get the time a file gets uploaded to my SFTP server, sometimes these files are big and get overwritten every day, I've tried ctime, atime and mtime but it still shows up the file modified time and not the time it finished…
dim_user
  • 969
  • 1
  • 13
  • 24
4
votes
1 answer

How to configure pysftp/paramiko connection with specific HostkeyAlgorithms - python

I need to automate transferring of a file from one server to a client's SFTP server. I've done this hundreds of time using Python's pysftp package. However, on this occasion, there's a HostkeyAlgorithm that I need to set. I've read through…
D_Vandagriff
  • 63
  • 1
  • 5
4
votes
1 answer

TypeError: expected str, bytes or os.PathLike object, not _io.BytesIO

Trying to upload a file off the internet to my server using ssh. Have the following code that uploads local files fine, but I do not know what more to do to get the picture bytes object to upload. from io import BytesIO import requests import…
equallyhero
  • 171
  • 1
  • 2
  • 16
4
votes
1 answer

Parallel downloads with Multiprocessing and PySftp

I'm trying to create a code to download N files at the same type using pysftp and multiprocessing libs. I made a basic python training, got pieces of codes and combined them into one, but I can't get it work out. I'd appreciate if somebody helps me…
4
votes
2 answers

Looking for an example to load/use a public ssh key with pysftp

I am working on a script in python using pysftp to establish an sftp connection. This script will run in Windows (Server 2012R2). The version of pysftp I have installed requires a host key, so I contacted my vendor and have acquired the public key…
Michael Linde
  • 51
  • 1
  • 1
  • 6
4
votes
1 answer

Verbose option in SFTP

I'm using Pysftp to sftp put a large number of files, and would love to get some progress outputs as it runs so I know how it's doing. Is there a verbose option (or equivalent) I can use to get that ouput? Thanks.
user1902853
  • 399
  • 1
  • 12
3
votes
0 answers

How can I speed up downloading files using paramiko?

I have written code for downloading file from SFTP server but the process is taking a lot of time. Could you please tell me is there any way to speed up the process? Code I am using - import paramiko ssh_client =…
Shivika
  • 209
  • 3
  • 15
3
votes
2 answers

How can I only download files with timestamps in their names from the last 14 days from an SFTP?

import os import datetime from datetime import datetime from dateutil.relativedelta import relativedelta from dateutil import parser import pysftp lt_all = [] # disable hostkey checking cnopts = pysftp.CnOpts() cnopts.hostkeys = None lt_all =…
3
votes
2 answers

Slow upload of many small files with SFTP

When uploading 100 files of 100 bytes each with SFTP, it takes 17 seconds here (after the connection is established, I don't even count the initial connection time). This means it's 17 seconds to transfer 10 KB only, i.e. 0.59 KB/sec! I know that…
Basj
  • 41,386
  • 99
  • 383
  • 673
1 2
3
24 25