Skip to main content

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 .md files 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


Download files

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

Source Distribution

qwen_mt_tool-0.2.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

qwen_mt_tool-0.2.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

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

Hashes for qwen_mt_tool-0.2.0.tar.gz
Algorithm Hash digest
SHA256 535cf84721da64decd7a7663d7a84ddbe59b1dbc963940cbca7a69071a628e11
MD5 d185508fe7dd5faa90f7f43179f42d82
BLAKE2b-256 3a11cfa9f17ddb2d92fdbb32000762e7cd73fab3ed66cc22e94dea98a252b997

See more details on using hashes here.

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

Hashes for qwen_mt_tool-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ec44959d42cd82cecadb077920abb33a8e71833a9508040eed2d45c9147a0c6
MD5 3add4ea2c0524fbc17e31bec02d40d77
BLAKE2b-256 a40fee431fb8c53fee9e66cb78a5df0e0302af850747d3d6fd187262f451d092

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