使用 python 和 xlrd 读取工作簿属性 [英] Read workbook properties using python and xlrd

查看:29
本文介绍了使用 python 和 xlrd 读取工作簿属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用 xlrd 读取 excel 文件属性?我指的不是单元格表示属性,而是一般工作簿属性.

Is there a way to read the excel file properties using xlrd? I refer not to cell presentation properties, but general workbook properties.

非常感谢.

推荐答案

除了用户名(最后一个保存工作表的人)之外,open_workbook 返回的 Book 实例似乎没有任何属性.

Apart from the username (last person to save the worksheet) the Book instance as returned by open_workbook does not seem to have any properties.

我递归地转储了这本书(如果是 xlrd.BaseObject,则转储它的 dict)并且无法以这种方式找到任何东西.测试文件肯定有作者、公司和一些自定义元数据.

I recursively dumped the Book ( dumping its dict if a xlrd.BaseObject) and could not find anything in that way. The test files for sure had an author, company and some custom metadata.

FWIW:LibreOffice 似乎也无法找到作者和公司(或不显示它们),但它确实在属性中显示了自定义元数据.

FWIW: LibreOffice does not seem to be able to find author and company either (or does not display them), but it does show custom metadata in the properties.

这篇关于使用 python 和 xlrd 读取工作簿属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆