Globe can be null like at https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q9831&format=json . Than "data['globe']"==None so globes[data['globe']] will throw a Keyerror. Changed it to default to earth when it's null.

https://mediawiki.org/wiki/Special:Code/pywikipedia/11703