ncvo / charity-commission-extract

Python utilities for handling the import of data from the Charity Commission data extract
43 stars 20 forks source link

Triggering KeyError #2

Closed tr4ssj2 closed 7 years ago

tr4ssj2 commented 7 years ago

Opened zip file: RegPlusExtract_January_2017.zip ERROR: Did not find extract_aoo_ref.bcp in zip file ERROR: Did not find extract_trustee.bcp in zip file ERROR: Did not find extract_charity_aoo.bcp in zip file ERROR: Did not find extract_main_charity.bcp in zip file ERROR: Did not find extract_charity.bcp in zip file ERROR: Did not find extract_financial.bcp in zip file ERROR: Did not find extract_remove_ref.bcp in zip file ERROR: Did not find extract_class_ref.bcp in zip file ERROR: Did not find extract_name.bcp in zip file ERROR: Did not find extract_class.bcp in zip file ERROR: Did not find extract_ar_submit.bcp in zip file ERROR: Did not find extract_objects.bcp in zip file ERROR: Did not find extract_partb.bcp in zip file ERROR: Did not find extract_acct_submit.bcp in zip file ERROR: Did not find extract_registration.bcp in zip file

drkane commented 7 years ago

I think the Charity Commission have changed the layout of the files - there's now a parent directory holding them. It should be possible to change the script to loop through the expected files and see if the actual filename matches the expected ones ignoring the folder it is in.

evanodell commented 7 years ago

As a workaround, you can also extract the files from the zip file and create a new zip file without the additional directory.

drkane commented 7 years ago

Fixed by 454b60d