Skip to main content

Microsoft Office(Word/Excel)ドキュメントからルビ(ふりがな)を削除するツール

Project description

Office Ruby Remover

Office Ruby Removerは、Microsoft WordドキュメントとExcelファイルからルビ(ふりがな)を削除するPythonライブラリです。

特徴

  • Word文書(.docx)からのルビ削除
  • Excelファイル(.xlsx)からのルビ削除
  • クロスプラットフォーム対応(Windows/Linux/Mac)

インストール

pip install office-ruby-remover

使用方法

Wordドキュメントのルビ削除

from word.remove_word_ruby import remove_word_ruby

# 基本的な使用方法
result = remove_word_ruby(
    input_path="input.docx",
    output_path="output.docx"
)

# 上書きを許可する場合
result = remove_word_ruby(
    input_path="input.docx",
    output_path="output.docx",
    overwrite=True
)

Excelファイルのルビ削除

from excel.remove_excel_ruby import remove_excel_ruby

# 基本的な使用方法
result = remove_excel_ruby(
    input_path="input.xlsx",
    output_path="output.xlsx"
)

# 上書きを許可する場合
result = remove_excel_ruby(
    input_path="input.xlsx",
    output_path="output.xlsx",
    overwrite=True
)

パラメータ

共通パラメータ

  • input_path (str | Path): 入力ファイルのパス
  • output_path (str | Path): 出力ファイルのパス
  • overwrite (bool): 出力ファイルが存在する場合に上書きを許可するかどうか(デフォルト: False)

戻り値

  • 0: 成功
  • 1: 失敗(ファイルが見つからない、権限エラーなど)

エラーハンドリング

from excel.remove_excel_ruby import remove_excel_ruby
import logging

# ログレベルの設定
logging.basicConfig(level=logging.INFO)

try:
    result = remove_excel_ruby("input.xlsx", "output.xlsx")
    if result == 0:
        print("ルビの削除が成功しました")
    else:
        print("ルビの削除に失敗しました")
except Exception as e:
    print(f"エラーが発生しました: {e}")

制限事項

  • Word文書: .docx形式のみ対応(.doc形式は非対応)
  • Excelファイル: .xlsx形式のみ対応(.xls形式は非対応)
  • 保護されたドキュメントは処理できない場合があります

ライセンス

本プロジェクトはMITライセンスの下で公開されています。詳細はLICENSEファイルをご覧ください。

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

office_ruby_remover-0.1.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file office_ruby_remover-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for office_ruby_remover-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de1ffbf612f4edbb20980630e5f9c7f49bcccd8d4df9fabc08b44708ea485a88
MD5 977e8de85883faeced705b3c68d0b362
BLAKE2b-256 2b7c69f4c332508c9661d063a1ba9bfaa1750edae238c8c91d568a5bddfd054d

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