Skip to content

dahlia/wikidata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0a3e0ec · Jul 7, 2024
Jan 27, 2023
Jan 29, 2023
Jan 27, 2023
Jul 7, 2024
Jul 5, 2024
Jul 7, 2024
Aug 3, 2020
Jan 27, 2023
Aug 3, 2020
Jul 5, 2024
Feb 14, 2017
Jan 29, 2023
Feb 22, 2017
Jan 27, 2023
Jul 7, 2024
Dec 8, 2018
Jan 29, 2023

Repository files navigation

Wikidata client library for Python

Latest PyPI version Documentation Status GitHub Actions

This package provides easy APIs to use Wikidata for Python.

>>> from wikidata.client import Client
>>> client = Client()  # doctest: +SKIP
>>> entity = client.get('Q20145', load=True)
>>> entity
<wikidata.entity.Entity Q20145 'IU'>
>>> entity.description
m'South Korean singer and actress'
>>> image_prop = client.get('P18')
>>> image = entity[image_prop]
>>> image
<wikidata.commonsmedia.File 'File:KBS "The Producers" press conference, 11 May 2015 10.jpg'>
>>> image.image_resolution
(820, 1122)
>>> image.image_url
'https://upload.wikimedia.org/wikipedia/commons/6/60/KBS_%22The_Producers%22_press_conference%2C_11_May_2015_10.jpg'