Skip to main content

ftp client/server for asyncio

Project description

ftp client/server for asyncio. (http://aioftp.readthedocs.org)

Features

  • Simple.

  • Extensible.

  • Proxy via twunnel3.

Dependencies

  • Python 3.3

  • asyncio

  • pathlib

or

  • Python 3.4+

License

aioftp is offered under the Apache 2 license.

Library Installation

pip install aioftp

Getting started

Client example

import asyncio
import aioftp


@asyncio.coroutine
def get_mp3(host, login, password):

    ftp = aioftp.Client()
    yield from ftp.connect(host)
    yield from ftp.login(login, password)
    for path, info in (yield from ftp.list(recursive=True)):

        if info["type"] == "file" and str.endswith(path.name, ".mp3"):

            yield from ftp.download(path, path.name)


loop = asyncio.get_event_loop()
tasks = (
    asyncio.async(get_mp3("server1.com", "login", "password")),
    asyncio.async(get_mp3("server2.com", "login", "password")),
    asyncio.async(get_mp3("server3.com", "login", "password")),
)
loop.run_until_complete(asyncio.wait(tasks))
loop.close()

Server example

Coming soon

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

aioftp-0.0.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file aioftp-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aioftp-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef4c47afafde3e88930b2fefbdda381a20b4c5b0dab6d58b1125f7eea8f2acd4
MD5 54cbc6066adf140d5cc477ed9fe680b1
BLAKE2b-256 6d0623d518297617689cb843f22e761f410dd0d895f2fec9e32ef6592f7c29c9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page