This project provides a script to convert various document formats (PDF, DOCX, HTML, TXT) into EPUB format. The primary goal is to automate the conversion process, though the final output might not be of the highest quality due to the automatic nature of the conversion.
- Converts PDF, DOCX, HTML, and TXT files to EPUB format.
- Handles bulk conversion, prioritizing file types as follows:
- DOCX
- HTML
- TXT
- Download the executable from the releases page.
- Move the executable to the directory where your files are located..
- Run the executable.
- Check the same directory for the output EPUB files..
To develop and build the executable yourself, follow these steps:
-
Clone the repository:
git clone https://github.com/jiuvirgil/universal-epub-converter.git cd universal-epub-converter
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Build the executable using PyInstaller:
pyinstaller --onefile convert_to_epub.py
- Add test documents to the
test_files
directory. - Run the tests:
python test_conversion.py
- Test files are sourced from Project Gutenberg.
- Replicate the current directory instead of making duplicates.
- Add support for multiple languages.
- Implement tests for multiple languages.
convert_to_epub.py
: The main script to convert files to EPUB format.converters.py
: Contains the conversion functions for each file type.test_conversion.py
: Script to run tests on the conversion functions.
For the best reading experience, we recommend using Aquile Reader.