gettext-translator-chatgpt
ChatGPT API backend for gettext-translator.
Usage from gettext-translator
gettext-translator --backend chatgpt --config sample-chatgpt.yaml --src en --dst fr_CA --po /path/to/example/messages.po
This command translates the messages.po file from English into Canadian French (fr_CA), using the provided OpenAI API key, using the gpt-4o-mini model processing 100 translations per batch. Very good results are produced by this model, which is a cheap one. See the chatgpt-sample.yaml configuration file for the example.
Configuration
apikey- Your OpenAI ChatGPT API key.
- Or, if you prefix the string with "env:", the value of the environment variable with the same name will be used. Example: apikey="env:MY_OPENAI_API_KEY" and then in the shell
export MY_OPENAI_API_KEY="sk-...".
modelthe model you want to use. See the Notes below.
Installation
pip install "gettext-translator[chatgpt]"
Notes
- You can find the name of the OpenAI ChatGPT models and their pricing here.
- Of course, you need an OpenAI API key.
License
Copyright (C) 2026 Rodolfo González González.
Licensed under GPL 3.0.
Metadata
Release files for gettext-translator-chatgpt 0.1.0
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 | |
|---|---|---|---|---|
| gettext_translator_chatgpt-0.1.0.tar.gz | 3.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gettext_translator_chatgpt-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 kB
Release files / gettext_translator_chatgpt-0.1.0.tar.gz
| Download URL | gettext_translator_chatgpt-0.1.0.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f688ea893c275318f23511bd72fde8b18991efc7163f91d29dad993243af762
|
|
BLAKE2b-256 checksum How to use checksums |
18d7dcfd6342075225fa0d0e3e14ce5c09a9c1debe3d3aa6536ea161d9e97cdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / gettext_translator_chatgpt-0.1.0-py3-none-any.whl
| Download URL | gettext_translator_chatgpt-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81d0f54096f2c877d1da104e89a1f807a89d4553f7bc871d38ebdb2cf6cc0bda
|
|
BLAKE2b-256 checksum How to use checksums |
3e56b66f2a6421e27396f46c39ed68abc5fbee4c5db301c8a5d2396729becc36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Security for gettext-translator-chatgpt 0.1.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.