kieranjol / IFIscripts

Detailed documentation is available here: http://ifiscripts.readthedocs.io/en/latest/index.html
http://ifiscripts.readthedocs.io/en/latest/index.html
MIT License
50 stars 34 forks source link

accession_register.py fail #370

Closed raecasey closed 4 years ago

raecasey commented 4 years ago

this script fails on ES1, ES2 and macmini. using a fresh filmographic export that worked ok with the batch accessioning job that this is for. Terminal out put below

R Last login: Wed Feb 5 14:45:37 on ttys003 ifi-mac-pro:~ admin$ accession_register.py -h usage: accession_register.py [-h] [-sorted_csv SORTED_CSV] [-pbcore_csv PBCORE_CSV] [-filmo_csv FILMO_CSV]

Generates a helper accessions register. Written by Kieran O'Leary.

optional arguments: -h, --help show this help message and exit -sorted_csv SORTED_CSV Path to sorted helper CSV -pbcore_csv PBCORE_CSV Path to technical/PBCore CSV. -filmo_csv FILMO_CSV Path to Filmographic CSV. Must contain reference numbers. ifi-mac-pro:~ admin$ accession_register.py -sorted_csv /Volumes/imports_ingests/ifa_material/film/register_csvs/register_2020-02-03T14_16_09_sorted.csv -pbcore_csv /Volumes/imports_ingests/ifa_material/film/register_csvs/2020-02-03T19_00_27_pbcore.csv -filmo_csv /Volumes/imports_ingests/ifa_material/film/register_csvs/filmo_csv_rc_20200203.csv Traceback (most recent call last): File "/Users/admin/ifigit/ifiscripts/accession_register.py", line 91, in main(sys.argv[1:]) File "/Users/admin/ifigit/ifiscripts/accession_register.py", line 69, in main if filmographic_record['Title'] == '': KeyError: 'Title' ifi-mac-pro:~ admin$

kieranjol commented 4 years ago

Cheers raelene, this is a python 3 thing. I have a workaround, but I can't fix this in the scripts until we completely switch over to genie plus csvs, rather than using older dB text works ones. I think gavin is the last user that was using dB text works csvs, and seeeing as he needed to get a new csv recently, perhaps this is the moment where we only support genie plus? It would make the ifb bai workflow a lot easier too as we would avoid a csv editing step as a result.

kieranjol commented 4 years ago

btw, this is actually less of a python3 thing and it's more of a genieplus thing - the key fields are called something else in GeniePlus than in DB Textworks - so the error there:

if filmographic_record['Title'] == '':
KeyError: 'Title'

So this is the main issue. The workaround is to manually change these filmographic headings:

Accession_register needs some changes to filmographic:
1. Title/name changes to Title
1. Filmographic URN changes to Reference Number
1. Series Title changes to TitleSeries
1. Episode No changes to EpisodeNo

but the longer term solution, one we drop DB TEXTWORKS CSV support, is for the script to look for the modern GeniePlus terms

raecasey commented 4 years ago

cool - yes i think we're ready to completely switch over whenever you are. Gavin has the knack of cretaing new filmo csvs so won't miss the dbtextworks ones i haven't been using the dbtextwork ones either R

On Wed, 5 Feb 2020 at 17:32, kieranjol notifications@github.com wrote:

Cheers raelene, this is a python 3 thing. I have a workaround, but I can't fix this in the scripts until we completely switch over to genie plus csvs, rather than using older dB text works ones. I think gavin is the last user that was using dB text works csvs, and seeeing as he needed to get a new csv recently, perhaps this is the moment where we only support genie plus? It would make the ifb bai workflow a lot easier too as we would avoid a csv editing step as a result.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kieranjol/IFIscripts/issues/370?email_source=notifications&email_token=AE64II5OMAGOQ4CKFL6VWKTRBLZ2NA5CNFSM4KQM73LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK4JKKQ#issuecomment-582522154, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE64IIYM5NOBLQ4S7X2NMDTRBLZ2NANCNFSM4KQM73LA .

raecasey commented 4 years ago

but in the meantime, - i'll change those things manually when i get that response again.

kieranjol commented 4 years ago

Thanks Raelene - i'm installing all the bits and bobs necessary to get the scripts and tools up and running on my new laptop. THis is a super slow process that takes many hours but I'll work in a proper fix once I am up and running.

kieranjol commented 4 years ago

Hi Raelene - this autoclosed with that commit, but instead of manually changing the CSV, can you run update.py, cos I think I've fixed it at a script level. If you're happy, then I'll send around an email to folks and let them know that Genieplus is now only supported. I think i have to change a few other scripts too, probably batchaccession as that needs a small edit too.

kieranjol commented 4 years ago

This was tested and all seems well!