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
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).
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
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"