automated Pipeline for parsing profiles of politically exposed persons (PEP) into Wikidata
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
844 B

  1. import os
  2. import yaml
  3. import json
  4. class WikidataPEP(object):
  5. def __init__(self, configFile):
  6. with open(configFile, "r") as stream:
  7. try:
  8. self.config = yaml.safe_load(stream)
  9. except yaml.YAMLError as exc:
  10. print(exc)
  11. def importMembersOfParliamentDict(self, listOfCountries):
  12. self.fullDictionaryMemberLists = {}
  13. for country in listOfCountries:
  14. print('started to parse data of member of ' + country + ' ..')
  15. f = open('crawlers/output/' + country +'MemberList.txt')
  16. text = f.read()
  17. self.fullDictionaryMemberLists[country] = eval(text)
  18. print(self.fullDictionaryMemberLists)