A powerful text-to-EPUB conversion tool
Project description
MyEPUBApp
A powerful text-to-EPUB conversion tool that transforms plain text files into standard EPUB e-book format.
Features
- ๐ Text to EPUB Conversion: Convert plain text files to EPUB-compliant e-books
- ๐ Chinese Optimization: Specially optimized for Chinese content with Chinese book title mark conversion
- ๐ Automatic Chapter Splitting: Automatically identify and split chapters using special marker symbols
- ๐ Flexible Modes: Support creating new EPUB or appending chapters to existing EPUB
- ๐๏ธ Modular Architecture: Clean code structure for easy maintenance and extension
- ๐ Detailed Logging: Complete operation logging
Installation
Requirements
- Python 3.8+
- pip package manager
Option 1: Install from PyPI (Recommended)
pip install myepubapp
Option 2: Install from Source
- Clone the project:
git clone https://github.com/eyes1971/myepubapp.git
cd myepubapp
- Install dependencies:
pip install -r requirements.txt
- Install in development mode:
pip install -e .
Usage
Basic Usage
1. Initialize New EPUB File
python -m myepubapp -i input.txt --output-epub output.epub
่ชๅๆธๅ็ๆ: ๆธๅๆๅพ่ผธๅ
ฅๆไปถๅ่ชๅ็ๆ๏ผไพๅฆ my_book.txt ๆ็ๆๆธๅ "My Book"
2. Append Chapters to Existing EPUB
python -m myepubapp -a input.txt --input-epub existing.epub --output-epub new.epub
Command Line Arguments
-i, --init: Initialize mode, create new EPUB file-a, --append: Append mode, add chapters to existing EPUBinput_file: Input text file path--input-epub, -ie: Existing EPUB file (required in append mode)--output-epub, -o: Output EPUB file path--convert-tags, -ct: Convert<>tags to Chinese book title marksใใ
Input File Format
Text files should use the following format for chapter splitting:
โปโ Introduction Content
This is the introduction page content.
It can span multiple paragraphs and will be displayed as a separate introduction page.
โปโ
ฐ Chapter 1 Title
Chapter content first paragraph...
โปโ
ฑ Chapter 1 Section 1 Subsection Title
Subsection content...
โปโ
ฒ Chapter 1 Section 1 Subsection 1
Deeper level content...
Format Description:
โปโ: Introduction page (creates a separate intro page)โปโ ฐ: Level 1 chapter (h1)โปโ ฑ: Level 2 chapter (h2)โปโ ฒ: Level 3 chapter (h3)
Examples
Create Simple EPUB
python -m myepubapp -i sample.txt --output-epub mybook.epub
Create EPUB with Tag Conversion
python -m myepubapp -i sample.txt --output-epub mybook.epub --convert-tags
Append Chapters to Existing EPUB
python -m myepubapp -a chapter2.txt --input-epub mybook.epub --output-epub mybook_updated.epub
Dependencies
ebooklib>=0.18.0: EPUB file processingbeautifulsoup4>=4.12.0: HTML/XML parsing
Project Structure
myepubapp/
โโโ core/ # Core modules
โ โโโ book.py # EPUB book class
โ โโโ chapter.py # Chapter class
โ โโโ metadata.py # Metadata class
โโโ generators/ # Generator modules
โ โโโ content.py # Content generator
โ โโโ toc.py # Table of contents generator
โโโ utils/ # Utility modules
โ โโโ file_handler.py # File handling
โ โโโ logger.py # Logging
โ โโโ text_processor.py # Text processing
โโโ exceptions/ # Custom exceptions
โ โโโ epub_exceptions.py
โโโ cli.py # Command line interface
โโโ __init__.py # Package initialization
Logging
All operations are logged to logs/myepubapp.log file.
License
This project is licensed under the MIT License.
Contributing
Issues and Pull Requests are welcome!
Version
Current version: 1.0.0
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file myepubapp-1.0.0.tar.gz.
File metadata
- Download URL: myepubapp-1.0.0.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
736f8e28a235b7d5f90cb32d495b72c807b22996e46cf1c45bba9677dbeac418
|
|
| MD5 |
3a110827a88f7f7ccf8758f4ed8247b8
|
|
| BLAKE2b-256 |
f9f25c32862325537702808e1cd39853f5b35bd9ad4281bef82d3659166fc973
|
File details
Details for the file myepubapp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: myepubapp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e10325aee75b1b64f9fd0b927a5963bc484ae37a11cdcea888693b699cf71073
|
|
| MD5 |
b9612446bc25e504350f958edab26647
|
|
| BLAKE2b-256 |
9a8a60b3f6c4106a5e2dadb6eee1147acd21553598ce438ac525e431e884ca3c
|