transpolibre
transpolibre is a Python program to automate translation of gettext PO files
using LibreTranslate, Ollama, or local models.
Install
PyPI Installation
To install with pip from PyPI, you can do something like this:
python -m venv venv
source venv/bin/activate
pip install -U setuptools pip wheel
pip install transpolibre
# For Ollama
pip install transpolibre[ollama]
# For Local Engine
pip install transpolibre[local]
# For all engines
pip install transpolibre[all]
Source Installation
Thusly, suit to taste:
git clone https://spacecruft.org/deepcrayon/transpolibre
cd transpolibre/
python -m venv venv
source venv/bin/activate
pip install -U setuptools pip wheel
pip install -e .
Help
$ transpolibre --help
usage: transpolibre [-h] [-a API_KEY] [-c CUDA_DEVICE] [-d] [-D {auto,cpu,gpu}] [-e {LibreTranslate,Ollama,Local}] [-f FILE] [-l] [-m MODEL] [-o] [-s SOURCE_LANG] [-t TARGET_LANG] [-u URL] [-v] [-V]
Translate PO files
options:
-h, --help show this help message and exit
-a API_KEY, --api-key API_KEY
LibreTranslate API key
-c CUDA_DEVICE, --cuda-device CUDA_DEVICE
Local CUDA device number (Default 0)
-d, --debug Debugging
-D {auto,cpu,gpu}, --device {auto,cpu,gpu}
Device to use for local translation: auto, cpu, gpu (Default auto)
-e {LibreTranslate,Ollama,Local}, --engine {LibreTranslate,Ollama,Local}
Translation engine (Default: LibreTranslate)
-f FILE, --file FILE PO file to translate
-l, --list List available languages
-m MODEL, --model MODEL
Model for Local or Ollama (Default local: ModelSpace/GemmaX2-28-9B-v0.1, default Ollama: aya-expanse:32b)
-o, --overwrite Overwrite existing translations
-s SOURCE_LANG, --source-lang SOURCE_LANG
Source Language ISO 639 code (Default en)
-t TARGET_LANG, --target-lang TARGET_LANG
Target Language ISO 639 code (Default es)
-u URL, --url URL Engine URL (Default LibreTranslate: http://127.0.0.1:8000, default Ollama: http://127.0.0.1:11434)
-v, --verbose Increase output verbosity
-V, --version Show version
Status
Beta.
AI
"Open Source" AI models are used to generate and edit some code.
Upstream
Projects used by transpolibre.
- https://libretranslate.com/
- https://www.gnu.org/software/gettext/manual/gettext.html
- https://polib.readthedocs.io
- https://github.com/argosopentech/LibreTranslate-py
- https://ollama.com/
License
Apache 2.0 or Creative Commons CC by SA 4.0 International. You may use this code, files, and text under either license.
Unofficial project, not related to upstream projects.
Upstream sources under their respective copyrights.
Copyright © 2025 Jeff Moe.
Metadata
Release files for transpolibre 0.8.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| transpolibre-0.8.15.tar.gz | 685.1 kB | Without provenance | Details for transpolibre-0.8.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| transpolibre-0.8.15-py3-none-any.whl | Python 3 | none | any | Details for transpolibre-0.8.15-py3-none-any.whl |
Total release size: 721.9 kB
Release files / transpolibre-0.8.15.tar.gz
| Download URL | transpolibre-0.8.15.tar.gz |
|---|---|
| Size | 685.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a43d562dda46b6f7ae0b187beee511c618ea2e903d8672b9e1aaccc636d701c
|
|
BLAKE2b-256 checksum How to use checksums |
22a9940f83b331d1715d41dde9925dcb2526e304b2aedd529135a304521c1250
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / transpolibre-0.8.15-py3-none-any.whl
| Download URL | transpolibre-0.8.15-py3-none-any.whl |
|---|---|
| Size | 36.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9e09e703fc0e4ae46f6a3fe2045ea118c20938468f3f3dd4b0009c682453cc8
|
|
BLAKE2b-256 checksum How to use checksums |
ab203776442a0a076fd9f5a8626e35a49c61afc2884dde9a49c849cfc511352e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for transpolibre 0.8.15
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.