Skip to content

IliasElabbassi/Tree-Ftp-Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tree FTP Client

install

Clone the current repo

virtualenv env
./env/Scripts/activate # activate the virtual environement (depends on your OS)
pip install setuptools
python setup.py build
python setup.py install

How to use it

from TreeFtp import FTP_Client

host = "ftp.ubuntu.com" # or any other ftp server
username = "anonymous"
VERBOSE = True

ftp_client = FTP_Client.FTP_Client(
        host=host,
        username=username,
        verbose=VERBOSE
    ).launch() # launch() setup everything you need (you can pass a password throught this method also)

Or

If it do not launch

python ./TreeFtp/FTP_Client.py ftp.ubuntu.com anonymous -v

But you will probably need to change an import on the FTP_Client.py file (see FTP_Client.py file for more information).

Command implemented :

CMD : you can pass ant cmd not implemented directly here
USER : username cBouommand
PASS : password command
PASV : passive mode command
CWD : change working directory command
LIST : list files of the current directory

More

See output.txt inside the root directory for the output of the code above.

To change the level of recursion when exploring the files :

ftp_client = FTP_Client.FTP_Client(
        host=host,
        username=username,
        verbose=VERBOSE,
        level=3 # HERE
    ).launch()

To add a password to the ftp client :

ftp_client = FTP_Client.FTP_Client(
        host=host,
        username=username,
        verbose=VERBOSE,
    ).launch("my_password")

For the demo look at "TreeFtp Demo.mkv"

Releases

No releases published

Packages

No packages published

Languages