A CLI tool for translating markdown files using Qwen-MT
Project description
Qwen-MT Tool
A CLI tool for translating markdown files using Qwen-MT (via OpenAI compatible API).
Features
- Recursive Scanning: Automatically finds all
.mdfiles in a directory. - Dependency Awareness: Skips files that have already been translated (ending in
_zh_CN.md). - Concurrency: Translates multiple files in parallel for faster processing.
- Smart Splitting: Splits long documents into chunks to avoid token limits while preserving code blocks.
- Usage Tracking: Logs token usage to
usage.log.
Installation
pip install qwen-mt-tool
Usage
Prerequisites
You need a DashScope API Key. You can set it as an environment variable or pass it via command line.
export DASHSCOPE_API_KEY="sk-..."
Basic Usage
Translate a single file:
qwen-mt path/to/file.md
Translate all markdown files in a directory (recursive):
qwen-mt path/to/directory
Options
--workers <N>: Number of concurrent workers (default: 1).--api-key <KEY>: Explicitly provide the API key.
qwen-mt . --workers 4 --api-key "sk-..."
Output
Translated files will be created in the same directory with a _zh_CN.md suffix.
For example, README.md -> README_zh_CN.md.
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 Distribution
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 qwen_mt_tool-0.2.0.tar.gz.
File metadata
- Download URL: qwen_mt_tool-0.2.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
535cf84721da64decd7a7663d7a84ddbe59b1dbc963940cbca7a69071a628e11
|
|
| MD5 |
d185508fe7dd5faa90f7f43179f42d82
|
|
| BLAKE2b-256 |
3a11cfa9f17ddb2d92fdbb32000762e7cd73fab3ed66cc22e94dea98a252b997
|
File details
Details for the file qwen_mt_tool-0.2.0-py3-none-any.whl.
File metadata
- Download URL: qwen_mt_tool-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ec44959d42cd82cecadb077920abb33a8e71833a9508040eed2d45c9147a0c6
|
|
| MD5 |
3add4ea2c0524fbc17e31bec02d40d77
|
|
| BLAKE2b-256 |
a40fee431fb8c53fee9e66cb78a5df0e0302af850747d3d6fd187262f451d092
|