Python ftplib: an FTP protocol client
Answer: This module defines the class FTP and a few related items. That class implements the client side of the FTP protocol. You can write programs that perform automated FTP jobs, such as mirroring other FTP servers. The default encoding is UTF 8.
A client for FTP jobs
The module defines the class FTP and a few related items.
That class implements the client side of the FTP protocol.
You can write programs that perform automated FTP jobs, such as mirroring other FTP servers.
The module urllib.request also uses it to handle URLs that use FTP.
Defaults in the source docs
The default encoding is UTF 8, following RFC 2640.
For more information on FTP, see internet RFC 959.
A sample session connects to a host, logs in, and lists directory contents.
This module does not work or is not available on WebAssembly.
See also
Claims
- id: C1 claim: FTP implements the client side of the FTP protocol. source: S1 evidence: "The FTP class implements the client side of the FTP protocol."
- id: C2 claim: A typical job is mirroring other FTP servers. source: S1 evidence: "mirroring other FTP servers"
- id: C3 claim: The default encoding is UTF-8. source: S2 evidence: "The default encoding is UTF-8"
- id: C4 claim: The module defines the FTP class and a few related items. source: S2 evidence: "This module defines the class :class:
FTPand a few related items."
Sources
- [S1] ftplib — FTP protocol client. Python Software Foundation. https://docs.python.org/3/library/ftplib.html . License: PSF License Version 2. Accessed 2026-11-23.
- [S2] ftplib documentation (source). CPython. https://raw.githubusercontent.com/python/cpython/main/Doc/library/ftplib.rst . License: PSF License Version 2. Accessed 2026-11-23.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, ftplib — FTP protocol client; CPython, ftplib documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, ftplib — FTP protocol client; CPython, ftplib documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation.
Cite this
iinventedlight. 2026. "Python ftplib: an FTP protocol client." iinventedlight Library, iil:note:hv4bv3z4, version of 2026-11-23. https://iinventedlight.com/library/notes/python-ftplib/. License: CC-BY-4.0.
@misc{iil_note_hv4bv3z4,
author = {{iinventedlight}},
title = {{Python ftplib: an FTP protocol client}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/python-ftplib/},
note = {Permanent ID iil:note:hv4bv3z4. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- python-ftplib.schema.json (schema; CC-BY-4.0)
- python-ftplib.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-ftplib.md.