Download SFTP files using a glob to get all files & also keep a log to keep track of processing
Project description
WalkSFTP
This is project is a class that allows for a glob like sftp download to a temporary file and lets you process the downloaded data using processing_function. The log argument can be used to check if the get and process ran correctly so you can run and not pull files that have already been processed and keeps track of files based on their modified time. This uses threading to separate the glob sftp files and the process function.
Installation
Run the following to install:
pip install walk_sftp
Usage
from walk_sftp import WalkSFTP
def process(f)
try:
# if successfull
return True
except:
# if unsuccessfull
return False
WalkSFTP(
ftp_web_address,
username,
password,
start_date='2020-12-25', # optional
end_date='2020-12-28', # optional
print_out=True, # optional
processing_function=process, # optional
log='/some_path_to_log.p', # optional
)
Development walk_sftp
To install walk_sftp, along with the tools you need to develop and run tests, run the following in your virtualend:
$ pip install -e .[dev]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file walk_sftp-0.0.28.tar.gz
.
File metadata
- Download URL: walk_sftp-0.0.28.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0c580e1091513f9ef00258c92d50a2e1d5afb834daf10f0e00167561c9c740a |
|
MD5 | 6375d642292af5f0fd3873690d1d5e56 |
|
BLAKE2b-256 | 7c381cee92d2762d0392c39df2b66aa18e68d545704d71f366b2af8a002e9216 |
File details
Details for the file walk_sftp-0.0.28-py3-none-any.whl
.
File metadata
- Download URL: walk_sftp-0.0.28-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 273e4e8b3ea1dc16f640781a96bbd3ae92c2b1f4e6e47f1eca6694aef14dbf73 |
|
MD5 | 97636028dacd0dd0e908f5a4b9fa9087 |
|
BLAKE2b-256 | 79092460bdba12918ae30dfe1173863ae475403131d6f5be2f4cdd2bf9aa37ae |