Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

uptilab2/ftp-proxy-client

Repository files navigation

ftp-proxy-client travis

An FTP client for ftp-proxy

Current features:

  • Test successful connection to FTP server through proxy
  • List files and directories
  • Download a file

Installation

pip install ftp-proxy-client

Usage

    ftp_proxy = FtpProxy(host='foo', port=8080)
    ftp_client = ftp_proxy.connect('192.168.0.1', port=8080, login='foobar')

    assert ftp_client.ping() is True
    files = ftp_client.ls()
    assert files

    files2 = ftp_client.ls(recursive=True)
    assert len(files2) > len(files)

    files3 = ftp_client.ls(recursive=True, extension='.txt')
    assert files3[0].endswith('.txt')

    fp = ftp_client.download(path='/foo.txt')
    with open('/tmp/foo.txt', 'wb') as ff:
    ff.write(fp.read())
    assert fp.tell() > 0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages