Skip to main content

PiperBook

Converts an epub to a directory of mp3s using piper-tts.

$ piperbook -s 1.0 -p 0.5 -v "en_US-ryan-high" test.epub author/test
19:55:27	MainThread	Chapters count: 5.
19:55:27	MainThread	Converting chapters 1 to 5.
19:55:35	worker-0	[✓] Wrote file 1_test_epub.mp3
19:55:39	worker-1	[✓] Wrote file 2_test_epub.mp3
19:58:12	worker-1  [✓] Wrote file 3_test_epub.mp3
19:59:27	worker-0	[✓] Wrote file 4_test_epub.mp3
20:00:54	worker-1	[✓] Wrote file 5_test_epub.mp3
20:00:56	MainThread	Cleaned up 0 from cache.

Supports voices models as listed on the piper Readme

Usage

usage: piperbook [-h] [--start START] [--end END] [-s SPEED] [-v VOICE] [-p PAUSE] [-c] [-j PROCESSES] epub audiobook-folder

Convert epub file to audiobook directory of mp3s

positional arguments:
  epub                  Epub file
  audiobook-folder      Destination folder for the mp3 files

options:
  -h, --help            show this help message and exit
  --start START         chapter to start from [default: 1]
  --end END             chapter to finish at [default: -1]
  -s SPEED, --speed SPEED
                        speed of the generated audio (lower is faster!) [default: 1.0]
  -v VOICE, --voice VOICE
                        voice to use for the generated audio. To see valid options, see the docs for piper [default: en_US-ryan-high]
  -p PAUSE, --pause PAUSE
                        length of pauses between sentences [default: 0.5]
  -c, --clobber         overwrite existing files [default: False]
  -j PROCESSES, --processes PROCESSES
                        number of piper processes to use. Keep this value low--piper is threaded already. [default: 2]

Installation

Tested on Debian 12.

$ apt install python python-pip ffmpeg
$ pip install piperbook
$ piperbook --help

Bugs

Chapter detection and naming is very imperfect. Patches welcome.

TODO

  • m4b format support.
  • Use piper more intelligently

Credit

Epub chapterising logic stolen from epub_to_audiobook.

Metadata

Release files for piperbook 2023.9.24

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for piperbook 2023.9.24
File Size Uploaded Provenance Actions
piperbook-2023.9.24.tar.gz 7.6 kB Without provenance Details for piperbook-2023.9.24.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for piperbook 2023.9.24
File Interpreter ABI Platform Actions
piperbook-2023.9.24-py3-none-any.whl Python 3 none any Details for piperbook-2023.9.24-py3-none-any.whl

Total release size: 14.3 kB

Release files / piperbook-2023.9.24.tar.gz

Download URL piperbook-2023.9.24.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
deb1680bcc45b4d853d0d5ab78dd1ef1b213c6b6c091d46c48e5376a6ec1120c
BLAKE2b-256 checksum
How to use checksums
33b20e87a97ed73ba3e9d170811b323363289baf0312cad59ddc7abeaab0135d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / piperbook-2023.9.24-py3-none-any.whl

Download URL piperbook-2023.9.24-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
906ff52757222570a89c40feb9f79b46629376c6a36acd108e2e5c5b12f6d9db
BLAKE2b-256 checksum
How to use checksums
79f16129ce349d2ab803022c65d2b281e91cb761f0f74b0d41ad87c09c1a62ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Security for piperbook 2023.9.24

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2023.9.24 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page