本文整理汇总了Python中pymarc.Record.isbn方法的典型用法代码示例。如果您正苦于以下问题:Python Record.isbn方法的具体用法?Python Record.isbn怎么用?Python Record.isbn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymarc.Record
的用法示例。
在下文中一共展示了Record.isbn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handleXLSX
# 需要导入模块: from pymarc import Record [as 别名]
# 或者: from pymarc.Record import isbn [as 别名]
def handleXLSX(mapping, sheet, outputFolder, rowsToIgnore):
# mapping as defined in mapping function loadMapping
# sheet is the specific excel sheet that contains the data we're extracting
# rowsToIgnore is the number of rows at top of sheet that we don't care about
for row in sheet.rows[rowsToIgnore:]:
record = Record()
# for every key in our map
for i, key_entry in enumerate(mapping):
key = key_entry["field"]
# if the key isn't empty (i.e. we're not mapping that column)
if key:
addField(record, key_entry, [key[3], unicode(row[i].value)])
if DEBUG:
print record.title()
if record.isbn() <> None:
# Create unique UUID & add to record
bookUUID = str(uuid.uuid1())
record.add_field(Field(tag='001', data=bookUUID))
# Write out our marcxml for each row
writeMARCXML(record, os.path.join(outputFolder, record.isbn() + '.xml'))