Skip to main content

Function easing life :)

Project description

pynut - Laurent Tupin

It provides various functions to simplify the users life.

Installation

You can install the package from PyPI:

python -m pip install pynut-ftp

The package is supported on Python 3.7 and above.

How to use

You can call a function as this example:

$ ----------------------------------------------------
>>> from pyNutTools import nutDate
>>> nutDate.today()

This is the libraries I am using with the package

$ ----------------------------------------------------
>>> paramiko==2.11.0

Documentation

Temporary documentation for nutFtp :

Class c_FTP and c_SFTP allow you to Download / Upload on a server
Decorated to be a singleton as to keep the same instance / connection
FTP uses the ftplib library, SFTP paramiko

from pyNutFtp import nutFtp as ftp

1.1. Download FTP

ftp.fBl_ftpDownFileBinary(host, uid, pwd, ['FTP Folder'], fileName, folderToSave, bl_ssl = False)
    OR
_ftp = ftp.ftp_prep(host, uid, pwd, ['FTP Folder'], bl_ssl = False)
_ftp.ftp_DownloadFile(fileName, folderToSave)

1.2. Download SFTP

ftp.ssh_downFile(host, uid, pwd, ['FTP Folder'], fileName, folderToSave, int_port = 10022)
    OR
_sftp = sftp_prep(host, uid, pwd, ['FTP Folder'], int_timeout = -1, int_port = 10022)
_sftp.sftp_DownloadFile(fileName, folderToSave)

2.1 Upload FTP

ftp.fBl_ftpUpFile_Bi(host, uid, pwd, ['FTP Folder'], fileName, folderToSave,  bl_ssl = False)
    OR
_ftp = ftp_prep(host, uid, pwd, ['FTP Folder'], bl_ssl = False)
_ftp.ftp_UploadFile(fileName, folderToSave)

2.2 Upload SFTP

bl_success = ftp.ssh_upFile(host, uid, pwd, ['FTP Folder'], fileName, folderToSave, int_port = 10022)
    OR
_sftp = sftp_prep(host, uid, pwd, ['FTP Folder'], int_port = 10022)
_sftp.sftp_UploadFile(fileName, folderToSave)

END

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

pynut-ftp-2.1.5.tar.gz (21.1 kB view hashes)

Uploaded Source

Built Distribution

pynut_ftp-2.1.5-py3-none-any.whl (20.0 kB view hashes)

Uploaded Python 3

Supported by

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