ftpretty

raw JSON →
0.4.0 verified Mon Apr 27 auth: no python

ftpretty is a simple FTP wrapper that provides a more Pythonic interface for FTP operations, including get, put, list, and delete. Current version is 0.4.0, with a stable release cadence (last release in 2018).

pip install ftpretty
error AttributeError: module 'ftpretty' has no attribute 'ftpretty'
cause Importing incorrectly as 'import ftpretty' instead of 'from ftpretty import ftpretty'.
fix
Use 'from ftpretty import ftpretty' to import the class.
error ftpretty.ftpretty object has no attribute 'connect'
cause The connection is established when the object is created; there is no separate connect() method.
fix
Pass connection parameters directly to the constructor, e.g., ftpretty(host, user, password).
gotcha ftpretty does not support FTPS (FTP over SSL/TLS) out of the box. Use Python's ftplib.FTP_TLS directly if you need secure FTP.
fix Use ftplib.FTP_TLS or another library like Paramiko for SFTP.
gotcha The get() and put() methods overwrite files silently without warning. No confirmation or checksum verification.
fix Check for existing files manually before calling get() or put().
deprecated ftpretty uses Python's ftplib internally, which may not be available or may change in future Python versions. The library has not been updated since 2018.
fix Consider migrating to a more active library like Paramiko or ftputil if you need ongoing support.

Connect to an FTP server, download/upload files, and list directory contents.

from ftpretty import ftpretty

f = ftpretty(host='ftp.example.com', user='username', password='password')
f.get('remote_file.txt', 'local_file.txt')
f.put('local_file.txt', 'remote_file.txt')
print(f.list('/'))
f.close()