A Python script to adding/removing furigana for Japanese epub books.
Project description
furigana4epub
A Python script to add/remove furigana for Japanese epub books. Using Mecab and Unidic.
ある日の放課後だった。
ある日(ひ)の放課(ほうか)後(ご)だった。
Should work with Python3.6 or higher, but only tested with Python 3.7.5
Install
pip install furigana4epub
If you want to use the full version of UniDic, read this article.
Usage
To add furigana:
furigana4epub target.epub
To remove furigana:
furigana4epub -d target.epub
furigana4epub -h
usage: furigana4epub [-h] [-e EXTENSION] [-r] [-s SUFFIX] [-d] [-b] [-p]
paths [paths ...]
A Python script to add/remove furigana for Japanese epub books. Using Mecab
and Unidic.
positional arguments:
paths Paths of Japanese epub books,can be file names or file
folders
optional arguments:
-h, --help show this help message and exit
-e EXTENSION, --extension EXTENSION
File extension to filter by(default:.epub)
-r, --recursive Search through subfolders
-s SUFFIX, --suffix SUFFIX
suffix of the converted file(default:"_furigana" for
adding or "_no_furigana" for removing furiganas)
-d, --remove remove furigana from epub file
-b, --blod Covert <ruby> dot to html <b> tag before adding
furigana
-p, --rp Do not add ruby <rp> tag to provide fall-back
parentheses for browsers that do not support display
of ruby annotations.Result a smaller output but with
less compatibility.
A note for Kindle
If you are using Calibre for ebook conversion, choose azw3(KF8) output format.
Calibre's mobi output format wouldn't support <ruby>
tag.
Credits
This script is inspired by WebNovelCrawler, pinyin2epub ,have some codes from them.
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
Hashes for furigana4epub-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57d9d4fb290ce687270f955c292249be131e0283c03dad84cc6409c7ecbe1e2e |
|
MD5 | d341d175e9abfd1ae66befda6bbefd66 |
|
BLAKE2b-256 | bbce3a2dcc62473f5a4e76643ec8ae7832aa6f90841a53f4960737cf599d4eae |