deluged-client

An asynchronous client for Deluge


Keywords
deluge, client, async
License
Other
Install
pip install deluged-client==0.0.1

Documentation

Deluged Client

A basic asynchronous client for Deluge that supports Deluge's RPC interface and events.

` from deluged_client import Client import asyncio

try:
    loop.run_until_complete(client.connect())
    routine = client.daemon.get_method()
    res = loop.run_until_complete(routine)
    print(res.data)
except ClientError as e:
    print(e)
finally:
    loop.close()

`

Deluge RPC interface contains namespaces with each namespace exporting a list of methods. A call get_config on namespace core would require the following client.core.get_config(). RPC calls that require arguments can be called by simply passing the arguments. For example, add_torrent_file_async is defined as add_torrent_file_async(filename, filedump, options, save_state=True), so a call on the client will be

client.core.add_torrent_file_async(filename, filedump, options, save_state=True)

A list of Deluge's RPC methods can be found here: RPC Methods

However, it is not an exhaustive list and is missing some methods. I recommend searching for the @export decorator in Deluge's source or calling the RPC method daemon.get_method_list. Some methods are not exported, particularly daemon methods. A reference to them can be found in deluge/core/rpcserver.py.

An important method missing from the docs is 'daemon.set_event_interest' which requires a list of event names. Event names can be found in Deluge's source deluge/event.py. An example of listening for events can be found in examples/event.py

Requirements

This project uses Python's async/await syntax which requires a Python 3.5 or higher.

Only Deluge Daemon 2.0 or higher is supported. Support for Deluge 1.3 is planned.

  • python >= 3.5
  • deluge >= 2.0
  • blinker >= 1.4
  • pytest-asyncio [testing]
  • pytest-cov [testing]

Acknowledgements

The overall interface for the client was inspired by @rndusr and their Transmission TUI client stig