Package: shifter
______________________  _____ _____________                     1  2  3
  ________/ ___/___/ /_  __(_)___/ __/__/ /______ ________   R  │  │  │
    _____/___ \ __/ __ \ ___ ___/ /_ _/  __/_  _ \__/ ___/   └──┼──┼──┤
      ______/ / _/ / / /_/ / _/  __/  / /_  /  __/_/ /          │  │  │
        /____/  /_/ /_/ /_/   /_/     \__/  \___/ /_/           4  5  6shifteris aPythonlibrary for controllingtransmissionand uses the
version number of the newest version of transmission that it was written to
support(it will likely work for newer versions, but there is no guarantee).shifterhas been written in 2.x syntax and will work for both Python2.x and Python3.x starting with Python2.5.To install:$ pip install shifteror$ easy_install shifterFor versions of Python3.xshifteris converted using2to3. When
installing withpipor usingdistribute,shifterwill automatically
be converted to 3.x syntax. Otherwise you can run the2to3tool manually
with the following command:$ 2to3 -f future -f reduce -f urllib -w shifter.pyshifterwas designed to be a more lightweight and consistenttransmissionRPC library than what was currently available forPython. Instead of simply
using the keys/fields thattransmission-rpcspecifies which have a mix of
dashed separated words and mixed case words,shiftertries to convert all
keys to a more python oriented: underscore separated words. This conversion is
done so that it is still possible to specify the fields/argument specified intransmission-rpc, but if you do so your mileage may vary(probably want to
avoid it).shifteris designed to work with all versions oftransmission, but for
renamed fields before and after the transmission version 1.60 (RPC v5) you
must specify the correct argument names (no automatic renames)To useshifterto control a defaulttransmission-daemononlocalhost:>>> client = shifter.Client()
>>> client.list()which produces a list of dictionaries with the torrent information (keys are
the fields: client.list_fields), and is synonymous to calling>>> client.torrent.get(client.list_fields)To use different connection information:complete path>>> client = shifter.Client(address="https://host:port/path")default URL, but port change to 8080>>> client = shifter.Client(port=8080)default URL, but different host>>> client = shifter.Client(host="github.com")default URL, but use a username and password>>> client = shifter.Client(username='username', password='password')shifter’s RPC methods are namespaced into four sections:Client:port_test – return if transmission port is open.blocklist_update – update block list and return block list size.list(torrent.gethelper) – list basic torrent info for all torrentsClient.queue:move_bottom – move torrent to bottom of the queuemove_down – move torrent down in the queuemove_top – move torrent to the top of the queuemove_up – move torrent up in the queueClient.session:close – shutdown the transmission daemonget – get session propertiesset – set session propertiesstats – get session statisticsClient.torrent:add – add a new torrentget – get torrent propertiesfiles(torrent.gethelper) – get file information for one or more
torrentspercent_done(torrent.gethelper) – get torrent percent done for
one or more torrentsremove – remove a torrent from transmission and optionally delete the
dataset – set torrent propertiesset_location – set/move torrent location