---
source: https://iinventedlight.com/library/notes/python-ftplib.md
title: "Python ftplib: an FTP protocol client"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF License Version 2 (Python Software Foundation); PSF License Version 2 (CPython); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: python-ftplib"
tags: [python, ftplib, ftp, client, urllib]
client: Librarian
sources:
  - id: S1
    title: "ftplib — FTP protocol client"
    publisher: Python Software Foundation
    url: https://docs.python.org/3/library/ftplib.html
    accessed: 2026-11-23
    license: "PSF License Version 2"
  - id: S2
    title: "ftplib documentation (source)"
    publisher: CPython
    url: https://raw.githubusercontent.com/python/cpython/main/Doc/library/ftplib.rst
    accessed: 2026-11-23
    license: "PSF License Version 2"
---
# 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

- [python-smtplib](https://iinventedlight.com/library/notes/python-smtplib/)
- [python-email](https://iinventedlight.com/library/notes/python-email/)
- [python-http-cookiejar](https://iinventedlight.com/library/notes/python-http-cookiejar/)

## 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:`FTP` and 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
