aioftp
ftp client/server for asyncio (https://aioftp.rtfd.io)
Features
Simple.
Extensible.
Client socks proxy via siosocks (pip install aioftp[socks]).
Goals
Minimum usable core.
Do not use deprecated or overridden commands and features (if possible).
Very high level api.
Client use this commands: USER, PASS, ACCT, PWD, CWD, CDUP, MKD, RMD, MLSD, MLST, RNFR, RNTO, DELE, STOR, APPE, RETR, TYPE, PASV, ABOR, QUIT, REST, LIST (as fallback)
Server support this commands: USER, PASS, QUIT, PWD, CWD, CDUP, MKD, RMD, MLSD, LIST (but it’s not recommended to use it, cause it has no standard format), MLST, RNFR, RNTO, DELE, STOR, RETR, TYPE (“I” and “A”), PASV, ABOR, APPE, REST
This subsets are enough for 99% of tasks, but if you need something, then you can easily extend current set of commands.
Server benchmark
Compared with pyftpdlib and checked with its ftpbench script.
aioftp 0.8.0
STOR (client -> server) 284.95 MB/sec RETR (server -> client) 408.44 MB/sec 200 concurrent clients (connect, login) 0.18 secs STOR (1 file with 200 idle clients) 287.52 MB/sec RETR (1 file with 200 idle clients) 382.05 MB/sec 200 concurrent clients (RETR 10.0M file) 13.33 secs 200 concurrent clients (STOR 10.0M file) 12.56 secs 200 concurrent clients (QUIT) 0.03 secs
aioftp 0.21.4 (python 3.11.2)
STOR (client -> server) 280.17 MB/sec RETR (server -> client) 399.23 MB/sec 200 concurrent clients (connect, login) 0.22 secs STOR (1 file with 200 idle clients) 248.46 MB/sec RETR (1 file with 200 idle clients) 362.43 MB/sec 200 concurrent clients (RETR 10.0M file) 5.41 secs 200 concurrent clients (STOR 10.0M file) 2.04 secs 200 concurrent clients (QUIT) 0.04 secs
pyftpdlib 1.5.2
STOR (client -> server) 1235.56 MB/sec RETR (server -> client) 3960.21 MB/sec 200 concurrent clients (connect, login) 0.06 secs STOR (1 file with 200 idle clients) 1208.58 MB/sec RETR (1 file with 200 idle clients) 3496.03 MB/sec 200 concurrent clients (RETR 10.0M file) 0.55 secs 200 concurrent clients (STOR 10.0M file) 1.46 secs 200 concurrent clients (QUIT) 0.02 secs
Dependencies
Python 3.10+
0.13.0 is the last version which supports python 3.5.3+
0.16.1 is the last version which supports python 3.6+
0.21.4 is the last version which supports python 3.7+
0.22.3 is the last version which supports python 3.8+
0.26.3 is the last version which supports python 3.9+
License
aioftp is offered under the Apache 2 license.
Library installation
pip install aioftp
Getting started
Client example
WARNING
For all commands, which use some sort of «stats» or «listing», aioftp tries at first MLSx-family commands (since they have structured, machine readable format for all platforms). But old/lazy/nasty servers do not implement this commands. In this case aioftp tries a LIST command, which have no standard format and can not be parsed in all cases. Take a look at FileZilla «directory listing» parser code. So, before creating new issue be sure this is not your case (you can check it with logs). Anyway, you can provide your own LIST parser routine (see the client documentation).
import asyncio
import aioftp
async def get_mp3(host, port, login, password):
async with aioftp.Client.context(host, port, login, password) as client:
for path, info in (await client.list(recursive=True)):
if info["type"] == "file" and path.suffix == ".mp3":
await client.download(path)
async def main():
tasks = [
asyncio.create_task(get_mp3("server1.com", 21, "login", "password")),
asyncio.create_task(get_mp3("server2.com", 21, "login", "password")),
asyncio.create_task(get_mp3("server3.com", 21, "login", "password")),
]
await asyncio.wait(tasks)
asyncio.run(main())
Server example
import asyncio
import aioftp
async def main():
server = aioftp.Server([user], path_io_factory=path_io_factory)
await server.run()
asyncio.run(main())
Or just use simple server
python -m aioftp --help
Metadata
Release files for aioftp 0.28.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aioftp-0.28.3.tar.gz | 70.9 kB | With provenance | Details for aioftp-0.28.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aioftp-0.28.3-py3-none-any.whl | Python 3 | none | any | Details for aioftp-0.28.3-py3-none-any.whl |
Total release size: 115.4 kB
Release files / aioftp-0.28.3.tar.gz
| Download URL | aioftp-0.28.3.tar.gz |
|---|---|
| Size | 70.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f054f3af285b4958621220f04ce755e58907140181e95efa859369091c92d040
|
|
BLAKE2b-256 checksum How to use checksums |
aaeeeafe937266180209a5d503c51693381e551d708cc933bb42436a3d11f5ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logRelease files / aioftp-0.28.3-py3-none-any.whl
| Download URL | aioftp-0.28.3-py3-none-any.whl |
|---|---|
| Size | 44.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d40f1a790efa614df1ffbd3ea68d6cebf8ce89ef544f234801d7e8950445638
|
|
BLAKE2b-256 checksum How to use checksums |
3cf0a0d7a27907e2a825ee14ced143122eb3feff0f4b697f5ec76695dbb92dd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logSecurity for aioftp 0.28.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for aioftp-0.28.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.