CSV in. CSV out.
Only the words change.
A dependency-free Python library and CLI that translates the text columns of a CSV through hosted or local models — and preserves everything else, byte for byte.
Python 3.11+ · Standard library only · MIT license
| idkept | titleen → es | descriptionen → es | pricekept |
|---|---|---|---|
| 1 | Ratón inalámbricoWireless mouse | Ratón ergonómico 2.4GHzErgonomic 2.4GHz mouse | 19.99 |
| 2 | Cable USB-CUSB-C cable | Cable trenzado de 1mBraided 1m cable | 7.50 |
| 3 | Soporte para portátilLaptop stand | "Aluminio, plegable""Aluminium, foldable" | 34.00 |
Only text cells changed. Ids, prices, headers, quoting, row order, encoding, and line endings are byte-identical — even the quoted comma survives.
Byte-preserving by design
Delimiter, quoting, encoding, line endings, row order, and field counts are detected and reproduced exactly. Every run ends in an atomic write.
Zero dependencies
Pure standard library on Python 3.11+. Nothing to pin, audit, or
resolve — pip install csv-trans is the whole supply chain.
Enforced privacy modes
public, restricted, and local-only
boundaries are validated before any text leaves the machine and
re-checked on every provider call, including retries and fallbacks.
Bounded recovery
Failed batches walk a fixed ladder — retry, corrective retry, split, adaptive singletons, provider fallback. A cell that still fails keeps its original text and is reported, never dropped.
Up and running in a minute
Works with any OpenAI-compatible endpoint, Anthropic, a model on your own machine, or fully offline — see Providers and Getting started.
python -m pip install csv-transfrom csv_trans import translate
result = translate("catalog.csv", "en", "es")print(result.status.value) # "success"print(result.output_path) # translated_es_catalog.csv