Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tools:wikibaseintegrator [2025/02/10 01:40] darrontools:wikibaseintegrator [2025/02/11 07:30] (current) darron
Line 1: Line 1:
 ====WikibaseIntegrator==== ====WikibaseIntegrator====
  
-[[https://github.com/LeMyst/WikibaseIntegrator|WikibaseIntegrator]] is a python package designed to interact with Wikibase. It's a fork of [[https://github.com/SuLab/WikidataIntegrator|WikidataIntegrator]].+[[https://github.com/LeMyst/WikibaseIntegrator|WikibaseIntegrator]] is a python package written to interact with Wikibase and Jupyter notebooks. It's a fork of [[https://github.com/SuLab/WikidataIntegrator|WikidataIntegrator]].
  
-===Install===+===Clone===
  
 <code> <code>
Line 9: Line 9:
 cd WikibaseIntegrator cd WikibaseIntegrator
 </code> </code>
 +
 +===Install===
  
 <code> <code>
 python3 -m venv ~/.venvs/wikibaseintegrator python3 -m venv ~/.venvs/wikibaseintegrator
 ~/.venvs/wikibaseintegrator/bin/python -m pip install --upgrade pip setuptools ~/.venvs/wikibaseintegrator/bin/python -m pip install --upgrade pip setuptools
- 
 ~/.venvs/wikibaseintegrator/bin/python -m pip install . ~/.venvs/wikibaseintegrator/bin/python -m pip install .
 </code> </code>
  
 +===Test===
 +
 +<code>
 +source ~/.venvs/wikibaseintegrator/bin/activate.csh
 +</code>
 +
 +<code>
 +vi human.py
 +</code>
 +
 +<code>
 +#! /usr/bin/env 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')
 +
 +print(my_first_wikidata_item.get_json())
 +</code>
 +
 +<code>
 +chmod +x human.py
 +./human.py
 +</code>
 +
 +<code>
 +deactivate
 +</code>
 +
 +===Resources===
 +
 +[[https://jupyterlab.readthedocs.io/en/latest/|JupyterLab]]
 +
 +[[https://www.geeksforgeeks.org/python-web-scraping-tutorial/|Web scraping]]