How to create a bot

Use pywikibot

pywikibot is a python library based on the Mediawiki API. In this notebook we will see how to use the API using Python with pywikibot and lay the groundwork to later develop a bot or tool for Wikidata.

Use pywikibot for Wikidata:

If you want to setup pywikibot on your computer, check this tutorial:

Quick steps:

Create a new directory for your project Clone pywikibot in this directory: git clone --recursive pywikibot Run python to create Run python login to login with your account

Let's create a bot to keep the population counts up to date

The data is available from Open Data Zurich, in the dataset Bevölkerung nach Stadtquartier, seit 1970.