未提供项目说明
PyBookReader的Python项目详细描述
PyBookReader(WIP)
命令行界面(CLI)应用程序,使用Python文本到语音库pyttsx3
和{pybookreader
扫描、检测并将书籍存储到SQLite
数据库中。数据库存储在本地计算机中,因此您不必担心书籍被盗。另外,数据库只存储图书名称、路径位置等基本信息,不存储图书内容。在
此项目正在使用pdftotext
,因此您需要安装pdftotext
所需的一些依赖项。在
操作系统依赖项
这些指令假设您正在最近的操作系统上使用Python3。程序包名称 对于Python2或更旧的操作系统,可能会有所不同。在
Debian、Ubuntu和朋友
sudo apt install build-essential libpoppler-cpp-dev pkg-config python3-dev
软呢帽、红帽子和朋友
^{pr2}$macOS
brew install pkg-config poppler python
Windows
当前仅在使用conda时测试:
- 安装微软Visual C++构建工具< /LI>
- 通过conda安装poppler:
在conda install -c conda-forge poppler
参考号:pdftotext Github
安装
pip install PyBookReader
使用
Usage: pybookreader [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
read-book-from-db Read a book already stored in the database by the...
scan-books Scan books in a given directory
show-all-books Show all available books stored in the database
命令
扫描书籍
扫描--location
参数后给出的目录并存储所有书籍
如果要在扫描书籍后将其保存到数据库,请添加--save
标志。在
Usage: pybookreader scan-books [OPTIONS]
Scan books in a given directory
Options:
-l, --location TEXT Path to the folder contains your books
--save Save the books after scanning them
--help Show this message and exit.
例如
pybookreader scan-books -l "/Users/don/Documents/Books/" --save
显示所有书籍
显示数据库中存储的所有可用图书
使用
pybookreader show-all-books
read book from db
通过指定名称或ID来读取存储在数据库中的书
从停止阅读的最后一页开始阅读,如果是第一次阅读,则从开始阅读。
您还可以通过传递--start-from-page
参数指定要从中开始的特定页码
Usage: pybookreader read-book-from-db [OPTIONS]
Read a book already stored in the database by the book's name or its ID.
Options:
-b, --book TEXT Name of the book you want to read
-i, --id INTEGER ID of the book if it is in the database
--start-from-page INTEGER Start reading from the specified page
--help Show this message and exit.
示例:
pybookreader read-book-from-db -b "Learn Python the hard way.pdf" --start-from-page 20
停止阅读
要停止阅读,请按Ctrl + C
,然后pybookreader
将询问是否要存储进度,以便以后继续。在
- 项目
标签: