Skip to main content

Translate Django .po files automatically via LLM (Anthropic, Groq)

Project description

llm-po-translator

Automatically translate Django .po files via LLM — Anthropic (Claude) or Groq (Llama).

  • Skips already-translated entries
  • Strips venv/site-packages pollution
  • Rate limit detection: silences output after 3 consecutive 429s, counts silently, re-run to resume
  • Auto-detects language from path (locale/es/LC_MESSAGES/django.poes)
  • Works as a CLI or a Django management command

Install

pip install llm-po-translator            # no provider (bring your own)
pip install 'llm-po-translator[groq]'    # + Groq
pip install 'llm-po-translator[anthropic]' # + Anthropic
pip install 'llm-po-translator[all]'     # both

Setup

Set your API key and provider in your environment (or .env):

LLM_PROVIDER=groq         # anthropic | groq
LLM_API_KEY=gsk_...       # Groq key (gsk_...) or Anthropic key (sk-ant-...)

Usage

CLI

# Auto-detect language from path
llm-po-translate locale/es/LC_MESSAGES/django.po

# Explicit language
llm-po-translate locale/es/LC_MESSAGES/django.po es

# Override provider
llm-po-translate locale/ja/LC_MESSAGES/django.po --provider anthropic

# Verbose (raw API errors)
llm-po-translate locale/fr/LC_MESSAGES/django.po --verbose

Django management command

Add llm_po_translator to INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    "llm_po_translator",
]

Then:

# Auto-discover all locale/*/LC_MESSAGES/django.po
python manage.py translate_po

# Single file
python manage.py translate_po locale/es/LC_MESSAGES/django.po

# Override provider
python manage.py translate_po --provider groq

Providers

Provider Model Install
anthropic claude-haiku-4-5-20251001 pip install anthropic
groq llama-3.3-70b-versatile pip install groq

License

MIT

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

llm_po_translator-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

llm_po_translator-0.1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_po_translator-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.0 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"26.5"},"implementation":{"name":"CPython","version":"3.10.20"},"installer":{"name":"hatch","version":"1.17.0"},"openssl_version":"OpenSSL 3.6.1 27 Jan 2026","python":"3.10.20","system":{"name":"Darwin","release":"25.5.0"}} HTTPX2/2.3.0

File hashes

Hashes for llm_po_translator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0b8d1f8ca717ec36abd95f3006a4559ae37b3f0f937f30ba798dd4e21ab3027a
MD5 f6c523558ea5273a87de446d03387932
BLAKE2b-256 735a6e444d3e6d5682747746a48c86aba5805531253ebe44172cd925433d0ac7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llm_po_translator-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.0 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"26.5"},"implementation":{"name":"CPython","version":"3.10.20"},"installer":{"name":"hatch","version":"1.17.0"},"openssl_version":"OpenSSL 3.6.1 27 Jan 2026","python":"3.10.20","system":{"name":"Darwin","release":"25.5.0"}} HTTPX2/2.3.0

File hashes

Hashes for llm_po_translator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 616b99dd51214a8019e746e0951f5b4562e8c3482688af8080d3c12c7ad1e9ad
MD5 f7eb907c8144d95dd479fb8ea66364cd
BLAKE2b-256 d45c669037e377d2e9e682e0395c8e95c490527d4f808de3d814ac70bad86839

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