Skip to main content

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()

Metadata

Release files for topftp 2024.9.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for topftp 2024.9.13
File Size Uploaded
topftp-2024.9.13.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for topftp 2024.9.13
File Interpreter ABI Platform
topftp-2024.9.13-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 kB

Release files / topftp-2024.9.13.tar.gz

Download URL topftp-2024.9.13.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9375d811a7ba5a0cafbefce91962a92499e913afa7552f1c0566fb1a50a89915
BLAKE2b-256 checksum
How to use checksums
e84b638e84f9968a064f044699626d7eca87ce89d026c85a4f04f091610cb4ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / topftp-2024.9.13-py3-none-any.whl

Download URL topftp-2024.9.13-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c709f751c2a0692cd13c5d28dfea91be05a679bef4841aa965951cecf702d23
BLAKE2b-256 checksum
How to use checksums
1892f2a096df6ecc7944e2724d542219cd64df7b2037c034d1d9976292c9a0fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

2024.9.13 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page