python client for ftp-proxy server
Project description
# ftp-proxy-client ![travis](https://travis-ci.com/uptilab2/ftp-proxy-client.svg?branch=master)
An FTP client for [ftp-proxy](https://github.com/uptilab2/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, directories = ftp_client.ls()
assert files and directories
files2, directories = ftp_client.ls(recursive=True)
assert len(files2) > len(files)
files3, directories = ftp_client.ls(recursive=True, extension='.txt')
assert not directories
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
```
An FTP client for [ftp-proxy](https://github.com/uptilab2/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, directories = ftp_client.ls()
assert files and directories
files2, directories = ftp_client.ls(recursive=True)
assert len(files2) > len(files)
files3, directories = ftp_client.ls(recursive=True, extension='.txt')
assert not directories
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
```
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
Built Distribution
File details
Details for the file ftp-proxy-client-0.0.7.tar.gz
.
File metadata
- Download URL: ftp-proxy-client-0.0.7.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e0fa31dac620b94d9bf76943f4adc11ba6dff2b097bdde564074887e3e4081a |
|
MD5 | 76751fbbd590e3151e152b07a23a9535 |
|
BLAKE2b-256 | 1032c2541c31f2c7ee1164f1375b25cb4c558d50e1ef16fa20d818508b966afe |
File details
Details for the file ftp_proxy_client-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: ftp_proxy_client-0.0.7-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cacc7fedb0772a2e564af39561ffcef63fb74f2b3fe724188321ae0393337f6 |
|
MD5 | 9cff277f7640985877fd6f022cd6613d |
|
BLAKE2b-256 | 52e79164e26dbdcd46765516d649961944f3fc2c87bb3fb02b5e2e9be171d98d |