Skip to main content

Tinbox

Translate documents from your terminal with cloud or local language models.

PyPI Python License: MIT

Tinbox reads PDFs, Word documents, and text files, then writes translations as text, JSON, or Markdown reports. It splits long text into chunks, can carry context and glossary terms between requests, and saves progress when you enable checkpoints.

Quick start · Providers · Workflows · CLI reference · Translation review · Contributing

Quick start

This example translates a short English note into German with GPT-6.1 Sol. Install uv and have an OpenAI API key ready. Tinbox requires Python 3.12 or newer.

Install Tinbox 0.3.0 or newer with OpenAI support:

uv tool install --python 3.13 "tinbox[openai]>=0.3.0"

Set your key, create a sample file, and translate it. These examples use a Bash or Zsh shell and the default OpenAI endpoint; unset OPENAI_BASE_URL if you previously configured another server.

export OPENAI_API_KEY="your-openai-api-key"
printf 'The library opens at nine.\n' > note.txt

tinbox translate note.txt --from en --to de \
  --model openai:gpt-6.1-sol --output note.de.txt

cat note.de.txt

Tinbox shows a translation plan, progress, and statistics in the terminal. note.de.txt contains only the translated text, for example:

Die Bibliothek öffnet um neun.

The wording can vary. Translation calls your provider and may incur API charges. To inspect the plan without contacting a model, add --dry-run to the translation command; it will not create an output file.

Prefer a local model? Use Gemma 4 with Ollama, or see provider setup for Claude, Gemini, and custom endpoints. The guide also covers installation from PyPI and upgrades.

What can I translate?

Input How Tinbox reads it What to expect
.txt Reads text and splits it into chunks by default Context-aware translation for longer text
.pdf Converts each page to an image Requires Poppler, PDF dependencies, and a vision-capable model
.docx Extracts paragraph text Table contents are omitted; Word formatting and page layout are not preserved

All inputs produce text, JSON, or a Markdown report. Tinbox does not export translated PDF or Word files. Translation quality and language coverage depend on the model; the CLI accepts a defined set of language codes.

Common tasks

I want to… Guide
Translate a PDF Install PDF dependencies, then translate the document
Keep terminology consistent Load and save a glossary
Continue an interrupted job Save progress and resume
Inspect source and translation side by side Opt-in translation review, with curated sentence matches and optional TypeSafe checks
Save metadata or inspect failed pages Choose an output format
Preview costs or change chunk size Translation workflows

Review a text translation

For a fresh context-aware .txt translation, preserve the source and translation chunks and render an offline report:

tinbox translate document.txt --from en --to de --model openai:gpt-6.1-sol \
  --output document.de.txt --save-review-input document.de.review.json

tinbox review document.de.review.json --output document.de.review.html

The translation review guide explains how to curate sentence matches, leave ambiguous regions unchecked, and optionally send matched groups to TypeSafe for participant, certainty, and quantifier checks. Reports preserve the translated text; matching and TypeSafe hints do not certify its quality. Only the explicit annotate-review command sends text to TypeSafe. Review files contain document text and require new output paths.

TranslateGemma with oMLX

For a local TranslateGemma server, use the dedicated TranslateGemma setup. It supports short text files with an explicit source language; it does not support PDFs, glossaries, or context-aware chunking.

Limits worth knowing

  • Costs are approximate. Tinbox uses fixed provider rates, not live model prices. --max-cost checks recorded cost after requests complete and is not a billing cap.
  • Model compatibility varies. The provider guide lists current examples and request settings. A dry run checks local options and estimates, not provider access or translation quality.
  • Check results before relying on them. A PDF translation can contain failed pages. JSON and Markdown reports include error details; see output formats.

Help and development

tinbox --help
tinbox translate --help
tinbox doctor

Read the CLI reference, setup troubleshooting, or contributing guide. For release and upgrade notes, see the changelog.

Licensed under the MIT License.

Metadata

Release files for tinbox 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tinbox 0.3.0
File Size Uploaded Provenance
tinbox-0.3.0.tar.gz 469.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tinbox 0.3.0
File Interpreter ABI Platform
tinbox-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 544.8 kB

Release files / tinbox-0.3.0.tar.gz

Download URL tinbox-0.3.0.tar.gz
Size 469.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b324a4617907b88c7d890d13f8e1e862a26639a329534e76f7f3beb3ac43bb9b
BLAKE2b-256 checksum
How to use checksums
9d1d52f93adfa5861cd7d3dec3dfc8dce87bc92f050328ced4774bc48e74fcbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / tinbox-0.3.0-py3-none-any.whl

Download URL tinbox-0.3.0-py3-none-any.whl
Size 75.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed9a57a1694a99a15b62595be59a7c2b7d32e491f73b7d1aa7fd646add1d82d9
BLAKE2b-256 checksum
How to use checksums
5d5b1fd230629c1aa736ff4a0eefb3cccf8552052b42c467b9524a6058f9ef53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for tinbox 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page