def _load_mods_files(filenames): """Return mods collection from file.""" pubs = [] for filename in filenames: with codecs.open(filename, 'r', 'utf8') as f: pubs.append(f.read()) mods = create_mods_collection(pubs) return mods
def fetch_csl_data(api, prefix, pids): """Return mods collection containing records of each pid.""" client = get_oai_client(api, prefix) pubs = [] for pid in pids: pubs.append(get_oai_document_metadata(client, pid)) mods = create_mods_collection(pubs) return mods