code
stringlengths
3
6.57k
kwargs.get("excluded_sets")
kwargs.get("oai_endpoint")
logging.info("Seeing All Sets Needed.")
logging.info("Seeing SetSpec List.")
isinstance(included_sets, list)
logging.info("Seeing Excluded SetSpec List.")
isinstance(excluded_sets, list)
Sickle(oai_endpoint)
ListSets()
oai_set.xml.find("oai:setSpec", namespaces=NS)
list(set(all_sets)
set(excluded_sets)
logging.info(remaining_sets)
HarvestIterator(sickle.iterator.OAIItemIterator)
next(self)
self.mapper(item)
hasattr(mapped, 'metadata')
logging.info("Skipping record with no metadata: %s", mapped.header.identifier)
self._next_response()
HarvestRecord(sickle.models.Record)
get_metadata(self)
self.xml.find('.//' + self._oai_namespace + 'metadata')
xml_to_dict(meta_data.getchildren()
harvest_oai(**kwargs)
kwargs.get("oai_endpoint")
kwargs.get("harvest_params")
logging.info("Harvesting from %s", oai_endpoint)
logging.info("Harvesting %s", harvest_params)
Sickle(oai_endpoint, retry_status_codes=[500,503], max_retries=3)
harvest_params.get("iterator", HarvestIterator)
sickle.ListRecords(**harvest_params)
logging.info("No records found.")
__init__(self, dag_id, timestamp)
etree.register_namespace("oai", "http://www.openarchives.org/OAI/2.0/")
etree.register_namespace("marc21", "http://www.loc.gov/MARC21/slim")
etree.Element("{http://www.openarchives.org/OAI/2.0/}collection")
append(self, record)
self.root.append(record)
tostring(self)
etree.tostring(self.root, encoding="utf-8")
decode("utf-8")
process_xml(data, writer, outdir, **kwargs)
kwargs.get("parser")
kwargs.get("records_per_file")
kwargs.get("dag")
kwargs.get("dag")
kwargs.get("timestamp")
kwargs.get("timestamp")
OaiXml(run_id, timestamp)
OaiXml(run_id, timestamp)
logging.info("Processing XML")
parser(record, **kwargs)
record.xpath(".//oai:header[@status='deleted']", namespaces=NS)
logging.info("Added record %s to deleted xml file(s)
oai_deletes.append(record)
int(records_per_file)
writer(oai_deletes.tostring()
OaiXml(run_id, timestamp)
logging.info("Added record %s to new-updated xml file", record_id)
oai_updates.append(record)
int(records_per_file)
writer(oai_updates.tostring()
OaiXml(run_id, timestamp)
writer(oai_updates.tostring()
writer(oai_deletes.tostring()
logging.info("OAI Records Harvested & Processed: %s", count)
logging.info("OAI Records Harvest & Marked for Deletion: %s", deleted_count)
perform_xml_lookup_with_cache()
perform_xml_lookup(oai_record, **kwargs)
len(cache)
logging.info("*** Fetching CSV lookup file from s3 ***")
kwargs.get("access_id")
kwargs.get("access_secret")
kwargs.get("bucket_name")
kwargs.get("lookup_key")
process.get_s3_content(bucket, lookup_key, access_id, access_secret)
pandas.read_csv(io.BytesIO(csv_data)
oai_record.xpath(".//marc21:record", namespaces=NS)
process.get_record_001(record)
logging.info("Reading in Record %s", record_id)
int(record_id)
len(set(parent_txt)
logging.info("Child XML record found %s", record_id)
split("||")
record.append(etree.fromstring(parent_node)
logging.error("Problem with string syntax:")
logging.error(error)
logging.error(parent_node)
dag_write_string_to_s3(string, prefix, **kwargs)
kwargs.get("access_id")
kwargs.get("access_secret")
kwargs.get("bucket_name")
logging.info("Writing to S3 Bucket %s", bucket_name)
hashlib.md5(string.encode("utf-8")
hexdigest()
format(prefix, our_hash)
process.generate_s3_object(string, bucket_name, filename, access_id, access_secret)
write_log(string, prefix, **kwargs)
logging.info(prefix)
logging.info(string)