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
#! /home/USERNAME/.venvs/wikibaseintegrator/bin/python
from wikibaseintegrator import WikibaseIntegrator
from wikibaseintegrator.wbi_config import config as wbi_config

wbi_config['USER_AGENT'] = 'Bot/0.1 (nobody@example.com)'

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())
chmod +x human.py
./human.py
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies