python读取epub文件_EbookLib 用于管理EPUB2 / EPUB3和Kindle文件的Python库

EbookLib是一个Python库,支持读写EPUB2/EPUB3电子书,以及Kindle文件的处理(Kindle支持正在开发中)。它提供简单的API,支持封面、目录、脊柱、指南、元数据等。该库被多个项目使用,并在Debian和Ubuntu中有预编译包。文档可在ebooklib.readthedocs.io查看。示例展示了如何读取和写入EPUB文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

About EbookLib

EbookLib is a Python library for managing EPUB2/EPUB3 and Kindle files. It's capable of reading and writing EPUB files programmatically (Kindle support is under development).

The API is designed to be as simple as possible, while at the same time making complex things possible too. It has support for covers, table of contents, spine, guide, metadata and etc.

EbookLib is used in Booktype from Sourcefabric, as well as sprits-it!, fanfiction2ebook, viserlalune and Telemeta.

Packages of EbookLib for GNU/Linux are available in Debian and Ubuntu.

Sphinx documentation is generated from the templates in the docs/ directory and made available at http://ebooklib.readthedocs.io

Usage

Reading

::

import ebooklib

from ebooklib import epub

book = epub.read_epub('test.epub')

for image in book.get_items_of_type(ebooklib.ITEM_IMAGE):

print image

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值