Install the Python library pageviewapi, that uses the PageView API from Wikimedia Foundation.
pip install git+https://github.com/Commonists/pageview-api.git
Download and extract Pywikibot, a Python library for interacting with Wikipedia:
wget https://tools.wmflabs.org/pywikibot/core_stable.tar.gz
tar xzf core_stable.tar.gz
Extract data from Wikipedia using wiki.py:
python3 core_stable/pwb.py wiki.py --languages "Theodor Fontane" > interwiki.tsv
Plot some of the columns using interwiki.gpi:
gnuplot interwiki.gpi
Starting point is the Wikipedia category https://de.wikipedia.org/wiki/Kategorie:Werk_von_Theodor_Fontane.
Extract data from Wikipedia using wiki.py:
python3 core_stable/pwb.py wiki.py --category "Kategorie:Werk_von_Theodor_Fontane" > works.tsv
Plot some of the columns using works.gpi:
gnuplot works.gpi
Download the result of the SPARQL query https://w.wiki/48T as TSV file contemporaries_wikidata.tsv and then extract data from Wikipedia using wiki.py:
python3 core_stable/pwb.py wiki.py --file contemporaries_wikidata.tsv > contemporaries.tsv
Plot some of the columns using contemporaries.gpi:
gnuplot contemporaries.gpi