Clutch - Transmission RPC for Python¶
Version 6.0.4.
Clutch is an open-source Python library for communicating over RPC with the Transmission BitTorrent client.
It’s handy for doing things like:
automating work when managing torrents
user interfaces and clients
collecting torrent stats
Installation¶
Pip¶
$ pip install transmission-clutch
Poetry¶
$ poetry add transmission-clutch
Get started¶
Import the package and make a client:
from clutch import Client
client = Client(address="http://localhost:9091/transmission/rpc")
Now issue a command to Transmission:
>>> client.torrent.accessor(fields=['id', 'files'], ids=[1]).dict(exclude_none=True)
{'result': 'success', 'arguments': {'torrents': [{'files': [{'bytes_completed': 1053440, 'length': 1053440, 'name': 'little_women/little_women.txt'}], 'id': 1}]}}
>>> client.torrent.accessor(fields=['id', 'files'], ids=[1]).json(exclude_none=True)
'{"result": "success", "arguments": {"torrents": [{"files": [{"bytes_completed": 1053440, "length": 1053440, "name": "little_women/little_women.txt"}], "id": 1}]}}'