Compress EPUB files
Project description
EPUB Crush
Compresses EPUB files to reduce size.
By default, all images, fonts, scipts, and styles will be removed from the EPUB.
Installation
This package is available via PyPI and can be installed from there.
pip install epubcrush
Performance
File | Original | txt | txtz | Images q=100 | Images q=50 | No Images |
---|---|---|---|---|---|---|
1 | 589kB | 27kB | 11kB | 583kB (99%) | 256kB (43%) | 26kB ( 4%) |
2 | 589kB | 91kB | 31kB | 583kB (99%) | 284kB (48%) | 46kB ( 8%) |
3 | 87kB | 89kB | 34kB | 76kB (87%) | 50kB (57%) | 39kB (45%) |
Why?
EPUBs may include features that may not be desirable from a privacy or efficiency standpoint. Publishers may choose to include high-res images, custom fonts, styles, scripts, and other features that bloat the size of EPUBs beyond what is needed for the text content of a book. This application strips away everything but the plain text content.
Why not use plain text?
EPUB adds a number of useful reading features (table of contents, metadata, etc) that are useful and not available in basic plain text. EPUBs are also compressed, so they will often be smaller than simple plain text.
Method of Operation
- Iterate files in container
- Remove all files that are not part of the document text or part of the EPUB structure
- Parse XML files
- Remove the following tags
- link
- meta
- style
- img
- picture
- audio
- video
- script
- Remove the following tags
- Parse opf file removing references to files that no longer exist
- Remove print page lists
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file epubcrush-2.0.5.tar.gz
.
File metadata
- Download URL: epubcrush-2.0.5.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.28.2 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2cf35e71580e8ab4143f734fd07cae846e52a34beac6cef81da4ab53ba6de67 |
|
MD5 | 2ab322c6b8a8b22d5861bde2f500ba0c |
|
BLAKE2b-256 | 9424d9146c553958ccda2482ed0bbc0abf7485d2d70cdf97a57c010676ed9217 |
File details
Details for the file epubcrush-2.0.5-py3-none-any.whl
.
File metadata
- Download URL: epubcrush-2.0.5-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.28.2 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb254721226591244b4661fc6c3652bb27e47065c339e12cabda6ef107cf3d46 |
|
MD5 | f31bd681f648321ad23dd029f88ea6ac |
|
BLAKE2b-256 | a04e7d6ca8f7338487ad9b958b2017032992c20f10832d0ba607f2710f7da623 |