Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

furigana4epub-1.0.2.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

furigana4epub-1.0.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file furigana4epub-1.0.2.tar.gz.

File metadata

  • Download URL: furigana4epub-1.0.2.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for furigana4epub-1.0.2.tar.gz
Algorithm Hash digest
SHA256 0ece180ca828e4ab1c17231dc91978535ff4936d79f62e21b0551537a266f34b
MD5 6e0adcbf49d7e02975bdaa2a070aae09
BLAKE2b-256 c66aba126888b88cab7c243508e5807d0dbecb68e33295bb90359c0ed1f1193f

See more details on using hashes here.

File details

Details for the file furigana4epub-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: furigana4epub-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for furigana4epub-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 57d9d4fb290ce687270f955c292249be131e0283c03dad84cc6409c7ecbe1e2e
MD5 d341d175e9abfd1ae66befda6bbefd66
BLAKE2b-256 bbce3a2dcc62473f5a4e76643ec8ae7832aa6f90841a53f4960737cf599d4eae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page