This is an old revision of the document!
Table of Contents
WikibaseIntegrator
WikibaseIntegrator is a python package designed to interact with Wikibase. It's a fork of WikidataIntegrator.
Clone
git clone --recursive https://github.com/LeMyst/WikibaseIntegrator
Perform operations inside the repository directory.
cd WikibaseIntegrator
Install
python3 -m venv ~/.venvs/wikibaseintegrator ~/.venvs/wikibaseintegrator/bin/python -m pip install --upgrade pip setuptools ~/.venvs/wikibaseintegrator/bin/python -m pip install .
Test
vi human.py
from wikibaseintegrator import WikibaseIntegrator from wikibaseintegrator.wbi_config import config as wbi_config wbi_config['USER_AGENT'] = 'MyWikibaseBot/1.0 (https://www.wikidata.org/wiki/User:MyUsername)' wbi = WikibaseIntegrator() my_first_wikidata_item = wbi.item.get(entity_id='Q5') # to check successful installation and retrieval of the data, you can print the json representation of the item print(my_first_wikidata_item.get_json())
~/.venvs/wikibaseintegrator/bin/python human.py