Skip to main content

No project description provided

Project description

PyBookReader (WIP)

Command Line Interface (CLI) application to read a PDF book for you, utilizing the Python Text-to-Speech library pyttsx3 and pdftotext and a few others. You can have all your books stored in a directory and have pybookreader to scan, detect and store your books to an SQLite database. The database is stored locally in your computer so you don't have to worry about the books being stolen. Plus, the database only stores basic information such as book's name, path location and so on, not the book content.

This project is using pdftotext and so you'll need to install some dependencies that pdftotext requires.

OS Dependencies

These instructions assume you're using Python 3 on a recent OS. Package names may differ for Python 2 or for an older OS.

Debian, Ubuntu, and friends

sudo apt install build-essential libpoppler-cpp-dev pkg-config python3-dev

Fedora, Red Hat, and friends

sudo yum install gcc-c++ pkgconfig poppler-cpp-devel python3-devel

macOS

brew install pkg-config poppler python

Windows

Currently tested only when using conda:

  • Install the Microsoft Visual C++ Build Tools
  • Install poppler through conda:
    conda install -c conda-forge poppler
    

Reference: pdftotext Github

Installation

pip install PyBookReader

Usage

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

Commands

scan-books

Scan the directory that given after --location argument and store all the books

Add --save flag if you want to save the books to the database after scanning them.

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.

For example

pybookreader scan-books -l "/Users/don/Documents/Books/" --save

show-all-books

Show all available books stored in the database

Usage

pybookreader show-all-books

read-book-from-db

Read a book that is stored in the database by specifying its name or its ID

The book will be read from the last read page where it was stopped, or from the beginning if it's read for the first time. You can also specify a specific page number that you want to start from, by passing --start-from-page argument

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.

Example:

pybookreader read-book-from-db -b "Learn Python the hard way.pdf" --start-from-page 20

Stop reading

To stop reading, press Ctrl + C,then pybookreader will ask if you want to store the progress so that you can continue later on.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyBookReader-1.0.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyBookReader-1.0.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file PyBookReader-1.0.1.tar.gz.

File metadata

  • Download URL: PyBookReader-1.0.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for PyBookReader-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c607438eb5a451b8b9d3355727bc0dd7b9a66db8f9b2ea17f88c1283154ada61
MD5 e7ec824730e1ee3cae38425887390c29
BLAKE2b-256 e4b738a29f21daafd90d141b7779c902be00ad3a7caac476b3946abc714abd34

See more details on using hashes here.

File details

Details for the file PyBookReader-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: PyBookReader-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for PyBookReader-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 32828c783a7a64456c3d8da6ffb6d0aa1a03309f737f5bffe3072e09e1e9ce0f
MD5 923a721ff37bd32fae57fa44997ee9c3
BLAKE2b-256 648f4972b20c7cd0d6768e2c2bfc109d0645d1a3da0f63e51bd51b639dcaff43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page