Image

class mwclient.image.Image(site, name, info=None)[source]
download(destination=None)[source]

Download the file. If destination is given, the file will be written directly to the stream. Otherwise the file content will be stored in memory and returned (with the risk of running out of memory for large files).

Recommended usage:

>>> with open(filename, 'wb') as fd:
...     image.download(fd)
Parameters:destination (file object) – Destination file
duplicatefiles(limit=None)[source]

List duplicates of the current file.

API doc: https://www.mediawiki.org/wiki/API:Duplicatefiles

imagehistory()[source]

Get file revision info for the given file.

API doc: https://www.mediawiki.org/wiki/API:Imageinfo

imageusage(namespace=None, filterredir='all', redirect=False, limit=None, generator=True)[source]

List pages that use the given file.

API doc: https://www.mediawiki.org/wiki/API:Imageusage