Definitions#
- APIKwargsT#
Type
Any
forkwargs
parameters for API methods.
- class APINames(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#
-
API namespaces for API endpoints.
e.g
torrents
inhttp://localhost:8080/api/v2/torrents/addTrackers
- Application = 'app'#
- Authorization = 'auth'#
- EMPTY = ''#
- Log = 'log'#
- RSS = 'rss'#
- Search = 'search'#
- Sync = 'sync'#
- TorrentCreator = 'torrentcreator'#
- Torrents = 'torrents'#
- Transfer = 'transfer'#
- class ClientCache(*args, client, **kwargs)#
-
Caches the client.
Subclass this for any object that needs access to the Client.
- class ClientT#
Type for this API Client.
alias of TypeVar(‘ClientT’, bound=
Request
)
- class Dictionary(data=None, **kwargs)#
Bases:
AttrDict
[V
]Base definition of dictionary-like objects returned from qBittorrent.
- FilesToSendT#
Type for Files input to API method.
- JsonValueT#
Type to define JSON.
alias of
Union
[None
,int
,str
,bool
,Sequence
[JsonValueT
],Mapping
[str
,JsonValueT
]]
- class List(list_entries=None, entry_class=None, **kwargs)#
Bases:
UserList
[ListEntryT
]Base definition for list-like objects returned from qBittorrent.
- class ListEntry(data=None, **kwargs)#
Bases:
Dictionary
[Union
[None
,int
,str
,bool
,Sequence
[JsonValueT
],Mapping
[str
,JsonValueT
]]]Base definition for objects within a list returned from qBittorrent.
- ListInputT#
Type for List input to API method.
alias of
Iterable
[Mapping
[str
,Union
[None
,int
,str
,bool
,Sequence
[JsonValueT
],Mapping
[str
,JsonValueT
]]]]
- class TorrentState(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#
-
Torrent States as defined by qBittorrent.
- Definitions:
- Usage:
>>> from qbittorrentapi import Client, TorrentState >>> client = Client() >>> # print torrent hashes for torrents that are downloading >>> for torrent in client.torrents_info(): >>> # check if torrent is downloading >>> if torrent.state_enum.is_downloading: >>> print(f'{torrent.hash} is downloading...') >>> # the appropriate enum member can be directly derived >>> state_enum = TorrentState(torrent.state) >>> print(f'{torrent.hash}: {state_enum.value}')
- ALLOCATING = 'allocating'#
- CHECKING_DOWNLOAD = 'checkingDL'#
- CHECKING_RESUME_DATA = 'checkingResumeData'#
- CHECKING_UPLOAD = 'checkingUP'#
- DOWNLOADING = 'downloading'#
- ERROR = 'error'#
- FORCED_DOWNLOAD = 'forcedDL'#
- FORCED_METADATA_DOWNLOAD = 'forcedMetaDL'#
- FORCED_UPLOAD = 'forcedUP'#
- METADATA_DOWNLOAD = 'metaDL'#
- MISSING_FILES = 'missingFiles'#
- MOVING = 'moving'#
- PAUSED_DOWNLOAD = 'pausedDL'#
- PAUSED_UPLOAD = 'pausedUP'#
- QUEUED_DOWNLOAD = 'queuedDL'#
- QUEUED_UPLOAD = 'queuedUP'#
- STALLED_DOWNLOAD = 'stalledDL'#
- STALLED_UPLOAD = 'stalledUP'#
- UNKNOWN = 'unknown'#
- UPLOADING = 'uploading'#
- class TrackerStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#
-
Tracker Statuses as defined by qBittorrent.
- Definitions:
- Usage:
>>> from qbittorrentapi import Client, TrackerStatus >>> client = Client() >>> # print torrent hashes for torrents that are downloading >>> for torrent in client.torrents_info(): >>> for tracker in torrent.trackers: >>> # display status for each tracker >>> print(f"{torrent.hash[-6:]}: {TrackerStatus(tracker.status).display:>13} :{tracker.url}")
- DISABLED = 0#
- NOT_CONTACTED = 1#
- NOT_WORKING = 4#
- UPDATING = 3#
- WORKING = 2#