{"id":13720973,"url":"https://github.com/aio-libs/aioftp","last_synced_at":"2025-05-07T13:31:09.497Z","repository":{"id":30381619,"uuid":"33934261","full_name":"aio-libs/aioftp","owner":"aio-libs","description":"ftp client/server for asyncio (http://aioftp.readthedocs.org)","archived":false,"fork":false,"pushed_at":"2024-03-19T19:27:07.000Z","size":2620,"stargazers_count":174,"open_issues_count":20,"forks_count":53,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-05-01T20:42:16.812Z","etag":null,"topics":["asyncio","ftp","ftp-client","ftp-server","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aio-libs.png","metadata":{"files":{"readme":"README.rst","changelog":"history.rst","contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-14T13:45:29.000Z","updated_at":"2024-05-09T14:07:36.001Z","dependencies_parsed_at":"2023-11-11T15:24:49.239Z","dependency_job_id":"69f10e96-021a-45a6-923e-b20e5c556b69","html_url":"https://github.com/aio-libs/aioftp","commit_stats":{"total_commits":603,"total_committers":30,"mean_commits":20.1,"dds":"0.11774461028192373","last_synced_commit":"8ac179261a57bcd292be5318840c4b4915b3afd6"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faioftp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faioftp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faioftp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aio-libs%2Faioftp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aio-libs","download_url":"https://codeload.github.com/aio-libs/aioftp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224604632,"owners_count":17339173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncio","ftp","ftp-client","ftp-server","python"],"created_at":"2024-08-03T01:01:10.649Z","updated_at":"2025-05-07T13:31:09.477Z","avatar_url":"https://github.com/aio-libs.png","language":"Python","funding_links":[],"categories":["网络"],"sub_categories":[],"readme":".. aioftp documentation master file, created by\n   sphinx-quickstart on Fri Apr 17 16:21:03 2015.\n   You can adapt this file completely to your liking, but it should at least\n   contain the root `toctree` directive.\n\naioftp\n======\n\n.. image:: https://github.com/aio-libs/aioftp/actions/workflows/ci-cd.yml/badge.svg?branch=master\n   :target: https://github.com/aio-libs/aioftp/actions/workflows/ci-cd.yml\n   :alt: Github actions ci-cd for master branch\n\n.. image:: https://codecov.io/gh/aio-libs/aioftp/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/aio-libs/aioftp\n\n.. image:: https://img.shields.io/pypi/v/aioftp.svg\n    :target: https://pypi.python.org/pypi/aioftp\n\n.. image:: https://img.shields.io/pypi/pyversions/aioftp.svg\n    :target: https://pypi.python.org/pypi/aioftp\n\n.. image:: https://pepy.tech/badge/aioftp/month\n    :target: https://pypi.python.org/pypi/aioftp\n\nftp client/server for asyncio (https://aioftp.rtfd.io)\n\n.. _GitHub: https://github.com/aio-libs/aioftp\n\nFeatures\n--------\n\n- Simple.\n- Extensible.\n- Client socks proxy via `siosocks \u003chttps://github.com/pohmelie/siosocks\u003e`_\n  (`pip install aioftp[socks]`).\n\nGoals\n-----\n\n- Minimum usable core.\n- Do not use deprecated or overridden commands and features (if possible).\n- Very high level api.\n\nClient use this commands: USER, PASS, ACCT, PWD, CWD, CDUP, MKD, RMD, MLSD,\nMLST, RNFR, RNTO, DELE, STOR, APPE, RETR, TYPE, PASV, ABOR, QUIT, REST, LIST\n(as fallback)\n\nServer support this commands: USER, PASS, QUIT, PWD, CWD, CDUP, MKD, RMD, MLSD,\nLIST (but it's not recommended to use it, cause it has no standard format),\nMLST, RNFR, RNTO, DELE, STOR, RETR, TYPE (\"I\" and \"A\"), PASV, ABOR, APPE, REST\n\nThis subsets are enough for 99% of tasks, but if you need something, then you\ncan easily extend current set of commands.\n\nServer benchmark\n----------------\n\nCompared with `pyftpdlib \u003chttps://github.com/giampaolo/pyftpdlib\u003e`_ and\nchecked with its ftpbench script.\n\naioftp 0.8.0\n\n::\n\n    STOR (client -\u003e server)                              284.95 MB/sec\n    RETR (server -\u003e client)                              408.44 MB/sec\n    200 concurrent clients (connect, login)                0.18 secs\n    STOR (1 file with 200 idle clients)                  287.52 MB/sec\n    RETR (1 file with 200 idle clients)                  382.05 MB/sec\n    200 concurrent clients (RETR 10.0M file)              13.33 secs\n    200 concurrent clients (STOR 10.0M file)              12.56 secs\n    200 concurrent clients (QUIT)                          0.03 secs\n\naioftp 0.21.4 (python 3.11.2)\n\n::\n\n    STOR (client -\u003e server)                              280.17 MB/sec\n    RETR (server -\u003e client)                              399.23 MB/sec\n    200 concurrent clients (connect, login)                0.22 secs\n    STOR (1 file with 200 idle clients)                  248.46 MB/sec\n    RETR (1 file with 200 idle clients)                  362.43 MB/sec\n    200 concurrent clients (RETR 10.0M file)               5.41 secs\n    200 concurrent clients (STOR 10.0M file)               2.04 secs\n    200 concurrent clients (QUIT)                          0.04 secs\n\npyftpdlib 1.5.2\n\n::\n\n    STOR (client -\u003e server)                             1235.56 MB/sec\n    RETR (server -\u003e client)                             3960.21 MB/sec\n    200 concurrent clients (connect, login)                0.06 secs\n    STOR (1 file with 200 idle clients)                 1208.58 MB/sec\n    RETR (1 file with 200 idle clients)                 3496.03 MB/sec\n    200 concurrent clients (RETR 10.0M file)               0.55 secs\n    200 concurrent clients (STOR 10.0M file)               1.46 secs\n    200 concurrent clients (QUIT)                          0.02 secs\n\nDependencies\n------------\n\n- Python 3.9+\n\n0.13.0 is the last version which supports python 3.5.3+\n\n0.16.1 is the last version which supports python 3.6+\n\n0.21.4 is the last version which supports python 3.7+\n\n0.22.3 is the last version which supports python 3.8+\n\nLicense\n-------\n\naioftp is offered under the Apache 2 license.\n\nLibrary installation\n--------------------\n\n::\n\n   pip install aioftp\n\nGetting started\n---------------\n\nClient example\n\n**WARNING**\n\nFor all commands, which use some sort of «stats» or «listing», ``aioftp`` tries\nat first ``MLSx``-family commands (since they have structured, machine readable\nformat for all platforms). But old/lazy/nasty servers do not implement this\ncommands. In this case ``aioftp`` tries a ``LIST`` command, which have no\nstandard format and can not be parsed in all cases. Take a look at\n`FileZilla \u003chttps://svn.filezilla-project.org/filezilla/FileZilla3/trunk/src/engine/directorylistingparser.cpp?revision=7322\u0026view=markup\u003e`_\n«directory listing» parser code. So, before creating new issue be sure this\nis not your case (you can check it with logs). Anyway, you can provide your own\n``LIST`` parser routine (see the client documentation).\n\n.. code-block:: python\n\n    import asyncio\n    import aioftp\n\n\n    async def get_mp3(host, port, login, password):\n        async with aioftp.Client.context(host, port, login, password) as client:\n            for path, info in (await client.list(recursive=True)):\n                if info[\"type\"] == \"file\" and path.suffix == \".mp3\":\n                    await client.download(path)\n\n\n    async def main():\n        tasks = [\n            asyncio.create_task(get_mp3(\"server1.com\", 21, \"login\", \"password\")),\n            asyncio.create_task(get_mp3(\"server2.com\", 21, \"login\", \"password\")),\n            asyncio.create_task(get_mp3(\"server3.com\", 21, \"login\", \"password\")),\n        ]\n        await asyncio.wait(tasks)\n\n    asyncio.run(main())\n\nServer example\n\n.. code-block:: python\n\n    import asyncio\n    import aioftp\n\n\n    async def main():\n        server = aioftp.Server([user], path_io_factory=path_io_factory)\n        await server.run()\n\n    asyncio.run(main())\n\nOr just use simple server\n\n.. code-block:: shell\n\n    python -m aioftp --help\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faio-libs%2Faioftp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faio-libs%2Faioftp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faio-libs%2Faioftp/lists"}