Skip to main content

DOCX translator using DeepL

Project description

docx-translator-smith

PyPI version Python versions License Status

A lightweight, developer-friendly DOCX translation tool powered by the DeepL API.
Provides both a Python library and CLI tools for batch-translating Microsoft Word (.docx) files while preserving structure.


✨ Features

  • Translate DOCX documents using the DeepL API
  • Preserve document structure (runs, paragraphs, tables)
  • Automatic deduplication for translation memory efficiency
  • Batch translation (entire folders)
  • Benchmark mode to measure throughput and latency
  • CLI commands suitable for automation

📦 Installation

pip install docx-translator-smith

Requires Python 3.11+.


🚀 Quick Start (CLI)

Translate an entire directory:

docx-translator     translate-dir     -s EN     -t JA     -i in_docs     -o out_docs

Benchmark translation performance:

docx-translator-bench     --src EN     --tgt JA     --input-dir in_docs     --output-dir out_docs     -v

🐍 Quick Start (Python)

from docx_translator.core.translator import translate_docx

src_path = "example.docx"
dst_path = "example.ja.docx"

translate_docx(src_path, dst_path, src_lang="EN", tgt_lang="JA")

🔑 Requirements

  • DeepL API key
  • Python 3.11 or later
  • python-docx, requests

Export your DeepL API key:

export DEEPL_API_KEY="your-key"

🛠 Development

git clone https://github.com/yeiichi/docx-translator
cd docx-translator
make venv
make install
make test

Build & publish:

make build
make dist-check
make publish

📄 License

MIT License © 2025 Eiichi Yamamoto
See LICENSE for full text.


👤 Author

Eiichi Yamamoto


📌 Project Status

This is an Alpha release — stable for CLI use, but internal APIs may evolve.


🔗 Links

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

docx_translator_smith-0.1.0.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

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

docx_translator_smith-0.1.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file docx_translator_smith-0.1.0.tar.gz.

File metadata

  • Download URL: docx_translator_smith-0.1.0.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for docx_translator_smith-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bc57a913ecd94f28d9da6dfeab93ae1f7cf7b60034ac77c8699d449ae8a07d69
MD5 9f8cb6f7f3c1881e9f7ca6ddf9b7968b
BLAKE2b-256 d58661c1aa85278141e713f009e36b0f0637145de7fab3429a5d4f4e0ef20cee

See more details on using hashes here.

File details

Details for the file docx_translator_smith-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for docx_translator_smith-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3aa93b69c2785b4c0b008197f1d25e5cd0411f525d26438fbb6a232c8ed9bbc
MD5 c0a53dafb90cddde821b018c6a2bccda
BLAKE2b-256 c1660f4fefca62aa151f6b559d31c6e2c85da398e71b18e898a0cf94cf537060

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