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.2.1

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.2.1
File Size Uploaded
topftp-2024.2.1.tar.gz 4.1 kB Details

Built distribution (wheel)

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

Total release size: 9.1 kB

Release files / topftp-2024.2.1.tar.gz

Download URL topftp-2024.2.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
61e3701af0c430dc307839d5b18ca72070ec42c8b6ac7ac03f2847a3e4dcf50e
BLAKE2b-256 checksum
How to use checksums
14d1af1313c9b25a038ca3c79911b5af887437e1514ab91b48b56a013e95aad1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

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

Download URL topftp-2024.2.1-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63c15334e77fff1cbf3f25e2b60d4ef642fdd283462748d9f4df906b4991f663
BLAKE2b-256 checksum
How to use checksums
f3ef06dc78e8d71254b395bba4d84493a87556bf9e5ac8650c5c93e493953269
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

2024.2.1 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