Metadata-Version: 2.1
Name: furigana4epub
Version: 1.0.2
Summary: A Python script to adding/removing furigana for Japanese epub books.
Home-page: https://github.com/Mumumu4/furigana4epub
Author: Mumumu
Author-email: 30195921+Mumumu4@users.noreply.github.com
License: MIT
Keywords: Japanese,readings,epub,furigana
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: Japanese
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Environment :: Console
Requires-Python: <4,>=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lxml
Requires-Dist: fugashi
Requires-Dist: unidic-lite
Requires-Dist: beautifulsoup4 (>=4.9.1)

# furigana4epub

A Python script to add/remove furigana for Japanese epub books. Using Mecab and Unidic.

 ある日の放課後だった。

ある<ruby>日<rp>(</rp><rt>ひ</rt><rp>)</rp></ruby>の<ruby>放課<rp>(</rp><rt>ほうか</rt><rp>)</rp>後<rp>(</rp><rt>ご</rt><rp>)</rp></ruby>だった。

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](https://github.com/polm/unidic-py#unidic-py), read [this article](https://github.com/polm/fugashi#installing-a-dictionary).
## 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](https://calibre-ebook.com) 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](https://github.com/tongyuantongyu/WebNovelCrawler), [pinyin2epub](https://github.com/shotazc/pinyin2epub)  ,have some codes from them.

