A simple Python script that scans a folder for EPUB files and counts the words in each one.
python epub_scanner.py [folder_path]If no folder path is provided, it will scan ~/Downloads by default.
# Scan current directory
python epub_scanner.py
# Scan a specific folder
python epub_scanner.py ~/Documents/Books
# Scan with absolute path
python epub_scanner.py /Users/Erick/Documents/Books- Python 3.6+
- No external dependencies (uses only Python standard library)
- Recursively scans the specified folder for
.epubfiles - Extracts text content from each EPUB file (EPUBs are ZIP archives containing HTML/XML)
- Counts words in the extracted text
- Displays a summary with word counts for each file
The script displays:
- A list of all EPUB files found
- Word count for each file
- Total word count across all files
- Average words per file