>>> dewiki = pywikibot.Site('de', 'wikipedia') >>> page = pywikibot.Page(dewiki, 'Hitlerbauten') >>> page.coordinates(primary_only=True) Coordinate(lat=48.314187, lon=14.273416, entity=http://www.wikidata.org/entity/Q2)
However, there are no primary coordinates (query). The method does:
if primary_only: return self._coords[0] if len(self._coords) > 0 else None else: return self._coords
ie. chooses the first instance, which is wrong and can confuse bots and other tools.
Primary coordinates are marked with "primary": "" key in the response.