wikidata.commonsmediaWikimedia Commons

New in version 0.3.0.

class wikidata.commonsmedia.File(client: wikidata.client.Client, title: str) → None

Represent a file on Wikimedia Commons.

image_mimetype

(Optional[str]) The MIME type of the image. It may be None if it’s not an image.

image_resolution

(Optional[Tuple[int, int]]) The (width, height) pair of the image. It may be None if it’s not an image.

image_size

(Optional[int]) The size of the image in bytes. It may be None if it’s not an image.

image_url

(Optional[str]) The image url. It may be None if it’s not an image.

page_url

(str) The canonical url of the page.

exception wikidata.commonsmedia.FileError

Exception raised when something goes wrong with File.