wikidata.commonsmediaWikimedia Commons#

New in version 0.3.0.

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

Represent a file on Wikimedia Commons.

property image_mimetype: str | None#

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

property image_resolution: Tuple[int, int] | None#

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

property image_size: int | None#

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

property image_url: str | None#

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

property page_url: str#

(str) The canonical url of the page.

exception wikidata.commonsmedia.FileError#

Exception raised when something goes wrong with File.