AI-powered Excel translation tool that preserves formatting, formulas, and data integrity
Project description
Rosetta
AI-powered Excel translation CLI. Translates Excel files while preserving formatting, formulas, and data integrity.
What it does
Rosetta translates all text in your Excel files using Claude AI, without breaking:
- Formulas and calculations
- Formatting (fonts, colors, borders)
- Merged cells and layouts
- Charts and images
- Dropdown menus
- Rich text (bold, italic within cells)
Prerequisites
You need a Claude API key from Anthropic.
- Go to console.anthropic.com
- Create an account (or sign in)
- Go to API Keys and create a new key
- Copy the key (starts with
sk-ant-...)
Note: API usage is billed by Anthropic. See anthropic.com/pricing for current rates. Translating a typical Excel file costs a few cents.
Installation
pip install rosetta-xl
Then set your API key:
# Linux/macOS
export ANTHROPIC_API_KEY=sk-ant-your-key-here
# Windows (Command Prompt)
set ANTHROPIC_API_KEY=sk-ant-your-key-here
# Windows (PowerShell)
$env:ANTHROPIC_API_KEY="sk-ant-your-key-here"
Or create a .env file in your working directory:
ANTHROPIC_API_KEY=sk-ant-your-key-here
Usage
# Translate to French
rosetta input.xlsx -t french
# Translate to Spanish with custom output name
rosetta input.xlsx -t spanish -o translated.xlsx
# Specify source language (auto-detected by default)
rosetta input.xlsx -s english -t german
# Translate only specific sheets
rosetta input.xlsx -t french --sheets "Sheet1" --sheets "Data"
# Add context for better translations (e.g., domain-specific terms)
rosetta input.xlsx -t french -c "Medical terminology document"
Options
| Option | Short | Description |
|---|---|---|
--target-lang |
-t |
Target language (required) |
--source-lang |
-s |
Source language (auto-detect if omitted) |
--output |
-o |
Output file path (default: input_translated.xlsx) |
--sheets |
Sheets to translate (can repeat, default: all) | |
--context |
-c |
Domain context for better accuracy |
--batch-size |
-b |
Cells per API call (default: 50) |
Examples
Translate a price list to multiple languages:
rosetta prices.xlsx -t french -o prices_fr.xlsx
rosetta prices.xlsx -t german -o prices_de.xlsx
rosetta prices.xlsx -t spanish -o prices_es.xlsx
Translate a medical form with context:
rosetta patient_form.xlsx -t french -c "Medical intake form with clinical terminology"
Translate only the "Questions" sheet:
rosetta survey.xlsx -t japanese --sheets "Questions"
Troubleshooting
"ANTHROPIC_API_KEY not set"
- Make sure you've exported the key:
export ANTHROPIC_API_KEY=sk-ant-... - Or create a
.envfile with the key
"Invalid API key"
- Check that your key starts with
sk-ant- - Make sure you copied the full key from console.anthropic.com
"Rate limit exceeded"
- You've hit Anthropic's rate limits. Wait a minute and try again
- Or reduce batch size:
rosetta input.xlsx -t french -b 20
How it works
- Extracts all text cells from your Excel file
- Sends text to Claude AI for translation (in batches)
- Writes translations back, preserving all formatting
- Saves the translated file
Your original file is never modified.
Requirements
- Python 3.11+
- Anthropic API key
License
MIT
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 rosetta_xl-0.1.0.tar.gz.
File metadata
- Download URL: rosetta_xl-0.1.0.tar.gz
- Upload date:
- Size: 69.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fff2ef425835881bc6871ad28ae1e8bd9b9a1321ad437af2e68f53c9b37bdae2
|
|
| MD5 |
3b93f865cd868ec4eeb7257cb6e23d12
|
|
| BLAKE2b-256 |
31d95009c54ad62ca33ccb79749827f42eacc34a8d25526c96f9fbf6f001125e
|
File details
Details for the file rosetta_xl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rosetta_xl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
689e11b3c147607446129885debec94fa589cf5d3f6a0ab3f9ae191e654d3974
|
|
| MD5 |
7fa2b363237d9d2ace75a4798ab3d823
|
|
| BLAKE2b-256 |
f40c05fdf36ab35555c19da6dac783290f0b032383ce1c7964be17bbce0e3382
|