mobi python库

mobi-python的Python项目详细描述


mobi python库

这应该被认为是阿尔法质量的软件。

这个库提供了一个访问未加密.mobi文件内容的小api。下面是一个简短的示例:

frommobiimportMobibook=Mobi("test/CharlesDarwin.mobi");book.parse();# this will print, 1 record at a time, the entire contents of the bookforrecordinbook:printrecord

这个库提供了对任何mobibook中包含的元数据的大量访问。例如,古登堡的物种起源:

>>>pprint(book.config){'exth':{'header length':356,'identifier':1163416648,'record Count':15,'records':{100:'Charles Darwin',101:'Project Gutenberg',105:'Natural selection',106:'1999-12-01',109:'Public domain in the USA.',112:'http://www.gutenberg.org/files/2009/2009-h/2009-h.htm',201:'\x00\x00\x00\x00',202:'\x00\x00\x00\x01',203:'\x00\x00\x00\x00',204:'\x00\x00\x00\x01',205:'\x00\x00\x00\x06',206:'\x00\x00\x00\x02',207:'\x00\x00\x00)',300:'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf4\xed\xec\xbe@\x94'}},'mobi':{'DRM Count':0,'DRM Flags':0,'DRM Offset':4294967295,'DRM Size':0,'EXTH flags':80,'First Image index':334,'First Non-book index':329,'Format version':6,'Full Name':'The Origin of Species by means of Natural Selection, 6th Edition','Full Name Length':64,'Full Name Offset':604,'Generator version':6,'Has DRM':False,'Has EXTH Header':True,'Input Language':0,'Language':9,'Mobi type':2,'Output Language':0,'Start Offset':2808,'Unique-ID':4046349163,'header length':232,'identifier':1297039945,'text Encoding':1252},'palmdoc':{'Compression':2,'Encryption Type':0,'Unknown':0,'Unused':0,'record count':327,'record size':4096,'text length':1336365}}>>>

检索作者和标题

可以使用author()和title()检索书籍的作者和书名 分别对mobi()对象的方法。parse()方法需要 已经打过电话了。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java编辑并重新运行spring引导单元测试,无需重新加载上下文即可加快测试速度   为什么我不能做演员?   java为什么是线程。join通常用于停止安卓中的线程   java从weblogic服务器调用JSON POST REST服务时收到400:错误请求   java在DeviceAdmin模式禁用时设置身份验证?   java SortedMap的keySet()能否始终安全地强制转换到SortedSet?   安卓 java。lang.NoSuchMethodException可包裹类   java JOGL库安装   javatomcat内存管理   java使用getString()中的变量   java将最小星号设置为评级栏   Java中字符串相等的println()方法。。。它到底是如何工作的?   java如何从文本中输出的数组中放入随机图像