datasets / publicbodies

A database of public bodies such as government departments, ministries etc.
http://publicbodies.org
MIT License
63 stars 26 forks source link

Fix IT import script #141

Closed augusto-herrmann closed 2 years ago

augusto-herrmann commented 2 years ago

The script that imports data from Italy raises an error:

python importIT.py 
Downloading indicePA data
indicePA data downloaded, saving to amministrazioni.txt
indicePA data saved
Converting data to publicbodies csv file
Traceback (most recent call last):
  File "importIT.py", line 101, in <module>
    convert_data()
  File "importIT.py", line 61, in convert_data
    if ipa_row["tipologia_istat"] in not_wanted_categories:
KeyError: 'tipologia_istat'

Looks like a column does not exist in the source data anymore.

We should fix it by replacing the absent column with an existing column, if available. If not, just give up using the data from the absent column.