Skip to main content

userdic-py

userdic-ng(Ruby 実装)を Python に移植した、日本語 IME ユーザー辞書変換ツールです。

必要環境

  • Python 3.9 以上

インストール

1) PyPI から入れる(推奨)

python -m pip install userdic-py

インストール後は userdic-py コマンドが使えます。

2) リポジトリから入れる

python -m pip install .

開発中に編集内容をそのまま反映したい場合:

python -m pip install -e .

3) make install でローカル配置する

/usr/local/bin にコマンド、/usr/local/lib/userdic-py にライブラリを配置します。

make install

別のインストール先を使う場合:

make install PREFIX=/path/to/prefix

削除する場合:

make uninstall

使い方

userdic-py [--input-encoding ENCODING] [--output-encoding ENCODING] <from> <to> < input > output

リポジトリを直接実行する場合は、従来どおり ./userdic.py でも動作します。

./userdic.py [--input-encoding ENCODING] [--output-encoding ENCODING] <from> <to> < input > output

<from> / <to> には次を指定できます。

  • mozc
  • google
  • anthy
  • canna
  • atok
  • msime
  • wnn
  • apple
  • generic

--input-encoding / --output-encoding には Python の codec 名を指定します。 例: utf-8, utf-16, utf-16-le, cp932, euc_jp

使用例

userdic-py generic mozc < generic.txt > mozc.txt
userdic-py --input-encoding cp932 --output-encoding utf-8 msime generic < msime.txt > generic.txt

仕様メモ

  • 入力エンコーディング未指定時は utf-16 / cp932 / euc_jp / utf-8 の順で読み取りを試行します。
  • 出力エンコーディング未指定時の既定値:
    • msime, atok: utf-16
    • wnn, canna: euc_jp
    • その他テキスト形式: utf-8
  • apple は plist(XML) 形式を読み書きします。
  • apple 入出力では --input-encoding / --output-encoding は利用できません。

リリース手順

リリース用のツールを用意します。

python -m pip install --upgrade build twine

バージョンは userdic_py/_version.py の __version__ を更新します。

配布物を作って検査します。

make check-dist

TestPyPI にアップロードしてインストール確認します。

make publish-test
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps userdic-py
userdic-py --version

問題がなければ PyPI にアップロードします。

make publish

Metadata

Release files for userdic-py 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for userdic-py 0.2.0
File Size Uploaded Provenance Actions
userdic_py-0.2.0.tar.gz 24.2 kB Without provenance Details for userdic_py-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for userdic-py 0.2.0
File Interpreter ABI Platform Actions
userdic_py-0.2.0-py3-none-any.whl Python 3 none any Details for userdic_py-0.2.0-py3-none-any.whl

Total release size: 46.0 kB

Release files / userdic_py-0.2.0.tar.gz

Download URL userdic_py-0.2.0.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c7a68a0a942e7370c188680255ade20e762798f89b3a465b1400c30858855ab9
BLAKE2b-256 checksum
How to use checksums
1a9d67e73e12b2f49f9f98e3884f16db87a5151b1ba62c3f1bfe083561d4407d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / userdic_py-0.2.0-py3-none-any.whl

Download URL userdic_py-0.2.0-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5be94faaacab1d448844903079947ffb175dbd86bbd0f1c86f4f2cf0306c46f6
BLAKE2b-256 checksum
How to use checksums
3aa8bf37ae50c4eedf66dad6890d79909254d6449f822b7f21909f3e69902a1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for userdic-py 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page