Metadata-Version: 2.4
Name: transduck
Version: 0.7.0
Summary: AI-native translation tool using source text as keys
License-Expression: MIT
Project-URL: Homepage, https://github.com/timnilson/transduck
Project-URL: Documentation, https://github.com/timnilson/transduck/blob/main/DOCUMENTATION.md
Project-URL: Repository, https://github.com/timnilson/transduck
Project-URL: Issues, https://github.com/timnilson/transduck/issues
Keywords: translation,i18n,internationalization,ai,openai,sqlite
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Internationalization
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0
Requires-Dist: openai>=1.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: babel>=2.12
Requires-Dist: python-dotenv>=1.0
Provides-Extra: claude
Requires-Dist: anthropic>=0.30; extra == "claude"
Provides-Extra: claude-code
Requires-Dist: claude-agent-sdk>=0.1; extra == "claude-code"
Provides-Extra: postgres
Requires-Dist: psycopg2-binary>=2.9; extra == "postgres"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-mock>=3.0; extra == "dev"

# TransDuck

AI-powered translation for apps and websites. Fast. Cheap. No keys to manage.

TransDuck translates your app's strings using AI, then caches them locally in SQLite so you never pay for the same translation twice. No translation files. No key naming. No sync headaches.

```python
import transduck
from transduck import ait, ait_plural

transduck.initialize()
transduck.set_language("DE")

ait("Welcome to Mallorca")              # → "Willkommen auf Mallorca"
ait("Hello {name}", vars={"name": "Tim"})  # → "Hallo Tim"
ait_plural("{count} night", "{count} nights", count=7)  # → "7 Nächte"
```

## Why TransDuck?

- **No keys to manage** — your source text is the key
- **No translation files** — translations live in a local SQLite database
- **Translate once, pay once** — cached lookups take ~0.015ms, zero API costs after first call
- **AI that understands context** — project and per-string context for accurate translations
- **Pluralization that works everywhere** — handles Russian (4 forms), Arabic (6 forms) automatically
- **Dirt cheap** — 1,000 strings × 5 languages ≈ $0.10 with gpt-4.1-mini

## Quick Start

```bash
pip install transduck
export OPENAI_API_KEY=sk-...
transduck init
```

## CLI

```bash
transduck scan --warm --langs DE,ES,IT   # scan codebase and translate everything
transduck translate "Hello" --to DE       # translate a single string
transduck stats                           # check your translation database
```

## Also available for JavaScript/TypeScript

```bash
npm install transduck
```

Includes React/Next.js integration via `transduck/react` with synchronous `t()` for client components.

## Links

- [GitHub](https://github.com/timnilson/transduck)
- [Full Documentation](https://github.com/timnilson/transduck/blob/main/DOCUMENTATION.md)
- [npm Package](https://www.npmjs.com/package/transduck)
