Python package to translate markdown files with multiple AI service providers.
Project description
markdown-translate-ai
This application allows you to translate Markdown files using various AI models.
Install with pip
This package is available on PyPi, so you can install it with pip
pip install markdown-translate-ai
Local installation form the repository
Ensure you have Python installed and install the required dependencies:
pip install -r requirements.txt
Environment Variables (API Keys)
export OPENAI_API_KEY="your_openai_api_key"
export ANTHROPIC_API_KEY="your_anthropic_api_key"
export GEMINI_API_KEY="your_gemini_api_key"
export DEEPSEEK_API_KEY="your_deepseek_api_key"
On Windows (PowerShell)
$env:OPENAI_API_KEY="your_openai_api_key"
$env:ANTHROPIC_API_KEY="your_anthropic_api_key"
$env:GEMINI_API_KEY="your_gemini_api_key"
$env:DEEPSEEK_API_KEY="your_deepseek_api_key"
Usage
Run the application with the following arguments:
markdown-translate-ai <input_file> <output_file> <target_lang> --model <model_name> [options]
Arguments:
<input_file>: Path to the input Markdown file.<output_file>: Path to save the translated Markdown file.<target_lang>: Target language for translation (e.g.,"Spanish").--model <model_name>: AI model to use for translation. See Available models
Optional Flags:
--source-lang <language>: Specify the source language (default:"English").--debug: Enable debug logging.--stats-file: Save translation statistics as a JSON file.
Available models
The application supports multiple AI providers, including:
- OpenAI (
gpt-4o,gpt-3.5-turbo, etc.) - Anthropic (
claude-3.5-sonnet,claude-3-haiku, etc.) - Gemini (
gemini-1.5-flash,gemini-1.5-pro, etc.) - DeepSeek (
deepseek-chat)
Full list of available models to use with the --models argument:
| Name | Points to |
|---|---|
gpt-4o |
gpt-4o |
gpt-4o-mini |
gpt-4o-mini |
gpt-3.5-turbo |
gpt-3.5-turbo |
gpt-4 |
gpt-4 |
gpt-4-turbo |
gpt-4-turbo |
o1 |
o1 |
o1-mini |
o1-mini |
o3-mini |
o3-mini |
o1-preview |
o1-preview |
claude-3.5-sonnet |
claude-3-5-sonnet-20241022 |
claude-3.5-sonnet-latest |
claude-3-5-sonnet-latest |
claude-3.5-haiku |
claude-3-5-haiku-20241022 |
claude-3.5-haiku-latest |
claude-3-5-haiku-latest |
claude-3-sonnet |
claude-3-sonnet-20240229 |
claude-3-haiku |
claude-3-haiku-20240307 |
claude-3-opus-latest |
claude-3-opus-latest |
gemini-1.5-flash |
gemini-1.5-flash |
gemini-1.5-pro |
gemini-1.5-pro |
gemini-2.0-flash |
gemini-2.0-flash |
deepseek-chat |
deepseek-chat |
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 markdown_translate_ai-0.1.2.tar.gz.
File metadata
- Download URL: markdown_translate_ai-0.1.2.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a316cccd5dd06df38b130721c8ad77579e9a0d197b6a72ad64578b22758c304
|
|
| MD5 |
fc52d46646c3f04d0170016f906fa796
|
|
| BLAKE2b-256 |
a1e6fa673da17aef286d750d07669a4e8dc128888c7dd774d735b195ead92e91
|
Provenance
The following attestation bundles were made for markdown_translate_ai-0.1.2.tar.gz:
Publisher:
publish-to-pypi.yml on KevinRohn/markdown-translate-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
markdown_translate_ai-0.1.2.tar.gz -
Subject digest:
1a316cccd5dd06df38b130721c8ad77579e9a0d197b6a72ad64578b22758c304 - Sigstore transparency entry: 171940914
- Sigstore integration time:
-
Permalink:
KevinRohn/markdown-translate-ai@3d670bab81bb2ec32b85e43ec74d13b0f8d3a536 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/KevinRohn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@3d670bab81bb2ec32b85e43ec74d13b0f8d3a536 -
Trigger Event:
release
-
Statement type:
File details
Details for the file markdown_translate_ai-0.1.2-py3-none-any.whl.
File metadata
- Download URL: markdown_translate_ai-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ff338333146f028c8834a0ad422e073dba664aecbfe377249117be2e86bd3e8
|
|
| MD5 |
e1e31697abc7297104e25be59cfee5a3
|
|
| BLAKE2b-256 |
7e2eedaa22a2e9607d1f323e137470693f3e14b49a0b5dbdd6a7dd93a4d6ef8f
|
Provenance
The following attestation bundles were made for markdown_translate_ai-0.1.2-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on KevinRohn/markdown-translate-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
markdown_translate_ai-0.1.2-py3-none-any.whl -
Subject digest:
1ff338333146f028c8834a0ad422e073dba664aecbfe377249117be2e86bd3e8 - Sigstore transparency entry: 171940918
- Sigstore integration time:
-
Permalink:
KevinRohn/markdown-translate-ai@3d670bab81bb2ec32b85e43ec74d13b0f8d3a536 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/KevinRohn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@3d670bab81bb2ec32b85e43ec74d13b0f8d3a536 -
Trigger Event:
release
-
Statement type: