{
  "markdown": "# Rosetta\n\n[![PyPI version](https://badge.fury.io/py/rosetta-xl.svg)](https://badge.fury.io/py/rosetta-xl)\n[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nAI-powered Excel translation CLI. Translates Excel files while preserving formatting, formulas, and data integrity.\n\n## What it does\n\nRosetta translates all text in your Excel files using Claude AI, without breaking:\n- Formulas and calculations\n- Formatting (fonts, colors, borders)\n- Merged cells and layouts\n- Charts and images\n- Dropdown menus\n- Rich text (bold, italic within cells)\n\n## Prerequisites\n\n**You need a Claude API key from Anthropic.**\n\n1. Go to [console.anthropic.com](https://console.anthropic.com/)\n2. Create an account (or sign in)\n3. Go to **API Keys** and create a new key\n4. Copy the key (starts with `sk-ant-...`)\n\n> **Note**: API usage is billed by Anthropic. See [anthropic.com/pricing](https://www.anthropic.com/pricing) for current rates. Translating a typical Excel file costs a few cents.\n\n## Installation\n\nInstall from [PyPI](https://pypi.org/project/rosetta-xl/):\n\n```bash\npip install rosetta-xl\n```\n\nThen set your API key:\n\n```bash\n# Linux/macOS\nexport ANTHROPIC_API_KEY=sk-ant-your-key-here\n\n# Windows (Command Prompt)\nset ANTHROPIC_API_KEY=sk-ant-your-key-here\n\n# Windows (PowerShell)\n$env:ANTHROPIC_API_KEY=\"sk-ant-your-key-here\"\n```\n\nOr create a `.env` file in your working directory:\n```\nANTHROPIC_API_KEY=sk-ant-your-key-here\n```\n\n## Usage\n\n```bash\n# Translate to French\nrosetta input.xlsx -t french\n\n# Translate to Spanish with custom output name\nrosetta input.xlsx -t spanish -o translated.xlsx\n\n# Specify source language (auto-detected by default)\nrosetta input.xlsx -s english -t german\n\n# Translate only specific sheets\nrosetta input.xlsx -t french --sheets \"Sheet1\" --sheets \"Data\"\n\n# Add context for better translations (e.g., domain-specific terms)\nrosetta input.xlsx -t french -c \"Medical terminology document\"\n```\n\n## Options\n\n| Option | Short | Description |\n|--------|-------|-------------|\n| `--target-lang` | `-t` | Target language (required) |\n| `--source-lang` | `-s` | Source language (auto-detect if omitted) |\n| `--output` | `-o` | Output file path (default: `input_translated.xlsx`) |\n| `--sheets` | | Sheets to translate (can repeat, default: all) |\n| `--context` | `-c` | Domain context for better accuracy |\n| `--batch-size` | `-b` | Cells per API call (default: 50) |\n\n## Examples\n\n**Translate a price list to multiple languages:**\n```bash\nrosetta prices.xlsx -t french -o prices_fr.xlsx\nrosetta prices.xlsx -t german -o prices_de.xlsx\nrosetta prices.xlsx -t spanish -o prices_es.xlsx\n```\n\n**Translate a medical form with context:**\n```bash\nrosetta patient_form.xlsx -t french -c \"Medical intake form with clinical terminology\"\n```\n\n**Translate only the \"Questions\" sheet:**\n```bash\nrosetta survey.xlsx -t japanese --sheets \"Questions\"\n```\n\n## Troubleshooting\n\n**\"ANTHROPIC_API_KEY not set\"**\n- Make sure you've exported the key: `export ANTHROPIC_API_KEY=sk-ant-...`\n- Or create a `.env` file with the key\n\n**\"Invalid API key\"**\n- Check that your key starts with `sk-ant-`\n- Make sure you copied the full key from [console.anthropic.com](https://console.anthropic.com/)\n\n**\"Rate limit exceeded\"**\n- You've hit Anthropic's rate limits. Wait a minute and try again\n- Or reduce batch size: `rosetta input.xlsx -t french -b 20`\n\n## How it works\n\n1. Extracts all text cells from your Excel file\n2. Sends text to Claude AI for translation (in batches)\n3. Writes translations back, preserving all formatting\n4. Saves the translated file\n\nYour original file is never modified.\n\n## Web App & API\n\nRosetta also includes a web application and REST API for browser-based translations.\n\n### Running the API server\n\n```bash\n# Install with uv (recommended)\nuv sync\n\n# Start the server\nuv run uvicorn rosetta.api:app --reload\n\n# Or with pip\npip install -e .\nuvicorn rosetta.api:app --reload\n```\n\nThe API runs at `http://localhost:8000` by default.\n\n### Running the frontend\n\n```bash\ncd frontend\nnpm install\nnpm run dev\n```\n\nThe frontend runs at `http://localhost:5173` and connects to the API.\n\n### API Endpoints\n\n| Endpoint | Method | Description |\n|----------|--------|-------------|\n| `/translate` | POST | Translate an Excel file (returns file) |\n| `/translate-stream` | POST | Translate with real-time progress via SSE |\n| `/estimate` | POST | Get cell count and cost estimate |\n| `/sheets` | POST | List sheet names in a file |\n| `/count` | POST | Count translatable cells |\n| `/preview` | POST | Preview cells that will be translated |\n| `/health` | GET | Health check |\n\n### Real-time Progress\n\nThe `/translate-stream` endpoint uses Server-Sent Events (SSE) to stream translation progress in real-time. The frontend automatically falls back to the standard `/translate` endpoint on networks that don't support SSE (e.g., corporate proxies).\n\n## MCP Integration\n\nRosetta includes MCP (Model Context Protocol) servers for both Claude Desktop and Claude Web.\n\n### For Claude Desktop (Local)\n\nAdd to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"rosetta\": {\n      \"command\": \"uv\",\n      \"args\": [\"run\", \"--directory\", \"/path/to/rosetta\", \"python\", \"-m\", \"rosetta.api.mcp\"],\n      \"env\": {\n        \"ANTHROPIC_API_KEY\": \"your-key-here\"\n      }\n    }\n  }\n}\n```\n\n**Usage:** Use local file paths for best results.\n```\nTranslate ~/Downloads/report.xlsx to French\n```\n\n### For Claude Web (Browser)\n\n**Note:** Claude.ai does not yet support custom MCP servers in the browser (as of January 2026).\n\n**Current recommendation:** Use the [web app](#web-app--api) for browser-based translations.\n\nSee [MCP_USAGE.md](MCP_USAGE.md) for detailed instructions.\n\n## Requirements\n\n- Python 3.11+\n- Anthropic API key\n\n## License\n\nMIT\n",
  "bytes": 5971,
  "sha": "3d25e0a66b1451d315ff6dbd69c706f77ad476e5b829c6ebbcb505be7077fa35",
  "repo_slug": "ewalid/rosetta",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_ewalid_rosetta_mcp_6480f962/readme"
}