Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

topftp-2024.9.13-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

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

Hashes for topftp-2024.9.13.tar.gz
Algorithm Hash digest
SHA256 9375d811a7ba5a0cafbefce91962a92499e913afa7552f1c0566fb1a50a89915
MD5 8f91b03b82e30c52cd940a75247a901e
BLAKE2b-256 e84b638e84f9968a064f044699626d7eca87ce89d026c85a4f04f091610cb4ba

See more details on using hashes here.

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

Hashes for topftp-2024.9.13-py3-none-any.whl
Algorithm Hash digest
SHA256 1c709f751c2a0692cd13c5d28dfea91be05a679bef4841aa965951cecf702d23
MD5 824d7de4652656f1f697b5d12aefcf59
BLAKE2b-256 1892f2a096df6ecc7944e2724d542219cd64df7b2037c034d1d9976292c9a0fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page