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:44] – [Install] 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]].
  
 ===Clone=== ===Clone===
Line 7: Line 7:
 <code> <code>
 git clone --recursive https://github.com/LeMyst/WikibaseIntegrator git clone --recursive https://github.com/LeMyst/WikibaseIntegrator
-</code> 
- 
-Perform all future operations inside the pywikibot repository directory. 
- 
-<code> 
 cd WikibaseIntegrator cd WikibaseIntegrator
 </code> </code>
Line 23: Line 18:
 </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]]