for key, value in collection.count_metadata_values().items(): collection.write_dict_as_wiki(value, key, 'wiki', alignment_template) if args.post_process: mapping_fields = ['ARTSIT', 'DATE', 'MEDIUM'] collection.retrieve_metadata_alignments(mapping_fields, alignment_template) mapping_methods = {}; reader = collection.post_process_collection(mapping_methods) template_name = 'Commons:Musée des Augustins/Ingestion'.encode('utf-8') front_titlefmt = "" variable_titlefmt = "%(ARTIST)s - %(TITLE)s" rear_titlefmt = " - Musée des Augustins - %(ACCESSION NUMBER)s" uploadBot = DataIngestionBot(reader=iter(collection.records), front_titlefmt=front_titlefmt, rear_titlefmt=rear_titlefmt, variable_titlefmt=variable_titlefmt, pagefmt=template_name) if args.upload: uploadBot.doSingle() elif args.dry_run: uploadBot.dry_run() if __name__ == "__main__": parser = UploadBotArgumentParser() arguments = parser.parse_args() main(arguments)
variable_titlefmt = "%(Titre)s" rear_titlefmt = " - Fonds Trutat - %(Cote)s" reader = iter(reversed(collection.records)) reader = itertools.islice(reader, 72, 280) uploadBot = DataIngestionBot(reader=iter(reader), front_titlefmt=front_titlefmt, rear_titlefmt=rear_titlefmt, variable_titlefmt=variable_titlefmt, pagefmt=template_name, subst=True, verifyDescription=False ) if args.upload: pass #uploadBot.run() elif args.dry_run: #for record in collection.records: # record.to_disk('%(Cote)s', 'toto') s = open('filename.xml', 'w') collection.write_metadata_to_xml(s) #uploadBot.dry_run() if __name__ == "__main__": parser = UploadBotArgumentParser() arguments = parser.parse_args() if not any(arguments.__dict__.values()): parser.print_help() else: main(arguments)
collection.write_dict_as_wiki(value, key, 'wiki', alignment_template) if args.post_process: mapping_fields = ['ARTSIT', 'DATE', 'MEDIUM'] collection.retrieve_metadata_alignments(mapping_fields, alignment_template) mapping_methods = {} reader = collection.post_process_collection(mapping_methods) template_name = 'Commons:Musée des Augustins/Ingestion'.encode( 'utf-8') front_titlefmt = "" variable_titlefmt = "%(ARTIST)s - %(TITLE)s" rear_titlefmt = " - Musée des Augustins - %(ACCESSION NUMBER)s" uploadBot = DataIngestionBot(reader=iter(collection.records), front_titlefmt=front_titlefmt, rear_titlefmt=rear_titlefmt, variable_titlefmt=variable_titlefmt, pagefmt=template_name) if args.upload: uploadBot.doSingle() elif args.dry_run: uploadBot.dry_run() if __name__ == "__main__": parser = UploadBotArgumentParser() arguments = parser.parse_args() main(arguments)
mapping_methods) metadata.categorisation_statistics(categories_counter, categories_count_per_file) template_name = 'Commons:Archives_Nationales/Ingestion'.encode('utf-8') front_titlefmt = "" variable_titlefmt = "%(Titre)s" rear_titlefmt = " - Archives Nationales - %(Cote du document)s" reader = iter(collection.records[2:]) uploadBot = DataIngestionBot(reader=iter(reader), front_titlefmt=front_titlefmt, rear_titlefmt=rear_titlefmt, variable_titlefmt=variable_titlefmt, pagefmt=template_name, subst=True, verifyDescription=False) if args.upload: uploadBot.run() elif args.dry_run: uploadBot.dry_run() if __name__ == "__main__": parser = UploadBotArgumentParser() arguments = parser.parse_args() if not any(arguments.__dict__.values()): parser.print_help() else: main(arguments)