@@ -0,0 +1,1630 @@
+from portality import models%0Afrom portality.core import es_connection%0Aimport esprit%0Aimport csv%0Afrom portality.util import ipt_prefix%0A%0AEMPTY_ISSN = %7B%0A%22query%22: %7B%0A        %22filtered%22: %7B%0A            %22filter%22: %7B%0A                %22bool%22: %7B%0A                    %22must%22: %7B%0A                        %22term%22: %7B%22admin.in_doaj%22: %22true%22%7D%0A                    %7D%0A                %7D%0A            %7D,%0A            %22query%22: %7B%0A                %22match_all%22: %7B%7D%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A%0Aif __name__ == %22__main__%22:%0A%0A    # import argparse%0A    # parser = argparse.ArgumentParser()%0A    # parser.add_argument(%22-o%22, %22--out%22, help=%22output file path%22)%0A    # args = parser.parse_args()%0A    #%0A    # if not args.out:%0A    #     print(%22Please specify an output file path with the -o option%22)%0A    #     parser.print_help()%0A    #     exit()%0A%0A    out = %22out.csv%22%0A%0A    with open(out, %22w%22, encoding=%22utf-8%22) as f:%0A        writer = csv.writer(f)%0A        writer.writerow(%5B%22ID%22, %22PISSN%22, %22EISSN%22%5D)%0A        count = 0%0A        for j in esprit.tasks.scroll(es_connection, ipt_prefix(models.Journal.__type__), q=EMPTY_ISSN, page_size=100, keepalive='5m'):%0A            journal = models.Journal(_source=j)%0A            count = count + 1%0A            pissn = journal.bibjson().get_one_identifier(%22pissn%22)%0A            eissn = journal.bibjson().get_one_identifier(%22eissn%22)%0A            if pissn == %22%22 or eissn == %22%22:%0A                try:%0A                    writer.writerow(%5Bjournal.id, pissn, eissn%5D)%0A                except AttributeError:%0A                    print(%22Error reading attributes for journal %7B0%7D%22.format(j%5B'id'%5D))%0A        print (%22Analyzed %7B%7D journals in DOAJ%22.format(count))%0A

add script to check whether we have empty string issns in our journals