The Python script compares the population in OSM (place nodes and boundary relations) with Wikidata. Before you edit/add data in either database, please be sure you have some idea of the hierarchical model of the region and how it is represented in OSM and Wikidata.
Python 3.x with the following libraries:
SPARQLWrapper
overpass >= 0.6.0
git clone https://github.com/ThomasBarris/populationWDvsOSM.git
cd populationWDvsOSM
.pip install SPARQLWrapper
pip install overpass
- change location and name of the html output file in line 10 in WdOSMpop.py if necessary
- change to bounding box in line 13 in WdOSMpop.py. A tool that helps you to find the bbox can be found here
python3 WdOSMpop.py
A file with the example output is >>> here <<<
> name : Göppingen
> type : node
> id : 240084735
> wikidata : Q4072
> population : 55846
> place : town
> boundary :
> WD Label : Göppingen
> WD Pop : 55846
> name : Ottenbach
> type : relation
> id : 2826029
> wikidata : Q80639
> population :
> place :
> boundary : administrative
> WD Label : Ottenbach
> WD Pop : 2442