Skip to content

Knarkoffer/epub-language-identifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EPUB Language Identifier

EPUB Language Identifier scans .epub and .mobi files and writes a CSV language report. It checks ebook metadata for both formats. For EPUB files, it also reads book text once and reuses that extracted text for ISBN-based language lookup and sampled text language detection.

The report columns are:

FILENAME,FROM_METADATA,FROM_ISBN,FROM_DETECTION

Setup

python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Usage

Scan the current directory recursively and write language-report.csv:

epub-language-identifier

Scan a specific directory:

epub-language-identifier --path /path/to/books

Choose a report path:

epub-language-identifier --path /path/to/books --output /tmp/language-report.csv

Scan only the selected directory:

epub-language-identifier --path /path/to/books --no-recursive

Show per-file warnings:

epub-language-identifier --path /path/to/books --verbose

Warnings cover metadata lookup, EPUB parsing, ISBN lookup, and text language detection failures. Without --verbose, files with failed detection steps are still included in the report with ? for unknown values.

Tests

python3 -m unittest discover -s tests

Notes

The CSV report is overwritten on each run. Keep ebook files outside the repository; .epub, .mobi, and generated report files are ignored by Git.

About

CLI tool that scans EPUB and MOBI ebooks and writes a CSV report of likely languages from metadata, ISBN lookup, and text detection.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages