How can I modify Microsoft Office Document's Metadata? I found number of result for the Jpg, PNG and PDF file. Any one can suggest Libraries for Office files Metadata? 解决方案 For newer formats they are often just zipped xml, so you can use standard libs to unzip and parse the xml. Some code to grab the document creator was previously posted as an answer on stackoverflow.import zipfile, lxml.etree# open zipfilezf = zipfile.ZipFile('my_doc.docx')# use lxml to parse the xml file we are interested indoc = lxml.etree.fromstring(zf.read('docProps/core.xml'))# retrieve creatorns={'dc': 'http://purl.org/dc/elements/1.1/'}creator = doc.xpath('//dc:creator', namespaces=ns)[0].textFor older formats you might want to look at the hachoir-metadata library 这篇关于Python:如何修改Microsoft Office文件的元数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-29 15:29