Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

walk_sftp-0.0.22.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

walk_sftp-0.0.22-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file walk_sftp-0.0.22.tar.gz.

File metadata

  • Download URL: walk_sftp-0.0.22.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.4

File hashes

Hashes for walk_sftp-0.0.22.tar.gz
Algorithm Hash digest
SHA256 2e39c9fc09da08f78711d94e13e2c7c3472167ea2ee8d602240cca06dda77187
MD5 caf43c1cd5c56027e97f638804311a91
BLAKE2b-256 cfc767c7271577b21674095bcc8cd9e151a34dca92e1c1a573f28cd03ffc10f0

See more details on using hashes here.

File details

Details for the file walk_sftp-0.0.22-py3-none-any.whl.

File metadata

  • Download URL: walk_sftp-0.0.22-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.4

File hashes

Hashes for walk_sftp-0.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 cffc1701f29205f908af00b931aea5fa633e1be3668aa7a3b764c029d914abfc
MD5 7041619d3ac0adca345ab6c257ceecbe
BLAKE2b-256 02b6d2be3d709474327a0720b9f5461e044d97cb39c779fa7acac8a44e84bf7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page