Metadata-Version: 2.4
Name: qwen-mt-tool
Version: 0.2.0
Summary: A CLI tool for translating markdown files using Qwen-MT
Project-URL: Homepage, https://github.com/yourusername/qwen-mt-tool
Project-URL: Repository, https://github.com/yourusername/qwen-mt-tool
Author-email: Your Name <your.email@example.com>
License-Expression: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: colorlog>=6.0.0
Requires-Dist: openai>=1.0.0
Description-Content-Type: text/markdown

# 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

```bash
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.

```bash
export DASHSCOPE_API_KEY="sk-..."
```

### Basic Usage

Translate a single file:

```bash
qwen-mt path/to/file.md
```

Translate all markdown files in a directory (recursive):

```bash
qwen-mt path/to/directory
```

### Options

- `--workers <N>`: Number of concurrent workers (default: 1).
- `--api-key <KEY>`: Explicitly provide the API key.

```bash
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`.
