a package on top of ftplib to use FTP easily
Project description
topftp
a package on top of ftplib to use FTP easily
installation
pip install topftp
usage
from topftp.ftp import FTP
host = "127.0.0.1"
user ="username"
password = "password"
port = 21
timeout = 5
ftp = FTP(host, user, password, port=port, timeout=timeout)
# set verbose to True to print exceptions
# set silent to True to not raise exceptions
# ftp.silent = True
# ftp.verbose = True
ftp.connect()
# list files in current directory
files, folders = ftp.listdir()
# download file
ftp.download("/file.txt", "local_file.txt")
# download file content to list
lines = ftp.download_to_list("/file.txt")
# upload file
ftp.upload("local_file.txt", "/remote_file.txt")
# upload from string
ftp.upload_from_string("Hello, topftp!", "/remote_file.txt")
# delete file
ftp.delete("/remote_file.txt")
# for missing methods on ftplib.FTP, you can use them directly
# ftp.some_method(*args, **kwargs)
# is same to
# ftp.ftp.some_method(*args, **kwargs)
# close connection
ftp.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
topftp-2024.9.13.tar.gz
(4.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file topftp-2024.9.13.tar.gz.
File metadata
- Download URL: topftp-2024.9.13.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9375d811a7ba5a0cafbefce91962a92499e913afa7552f1c0566fb1a50a89915
|
|
| MD5 |
8f91b03b82e30c52cd940a75247a901e
|
|
| BLAKE2b-256 |
e84b638e84f9968a064f044699626d7eca87ce89d026c85a4f04f091610cb4ba
|
File details
Details for the file topftp-2024.9.13-py3-none-any.whl.
File metadata
- Download URL: topftp-2024.9.13-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c709f751c2a0692cd13c5d28dfea91be05a679bef4841aa965951cecf702d23
|
|
| MD5 |
824d7de4652656f1f697b5d12aefcf59
|
|
| BLAKE2b-256 |
1892f2a096df6ecc7944e2724d542219cd64df7b2037c034d1d9976292c9a0fa
|