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
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file office_ruby_remover-0.1.1-py3-none-any.whl.
File metadata
- Download URL: office_ruby_remover-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de1ffbf612f4edbb20980630e5f9c7f49bcccd8d4df9fabc08b44708ea485a88
|
|
| MD5 |
977e8de85883faeced705b3c68d0b362
|
|
| BLAKE2b-256 |
2b7c69f4c332508c9661d063a1ba9bfaa1750edae238c8c91d568a5bddfd054d
|