Opentranslator - OpenAI | ChatGPT | Translate with python
Opentranslator is a simple command that can be used from the terminal to translate text (text plain or from a file). It uses OpenAI API to perform all operations, you can choose which ai engine to use by passing it as a parameter.
The following project was born to study OpenAI and how it works. If you would contribute open a pull request or issue on GitHub.
Mantained by
Usage
Required
- Python >= 3.7
- OpenAI Account
Input text
# You can save your OPENAI_API_KEY permanently in the user's environment
export OPENAI_API_KEY="${YOUR_OPENAI_API_KEY}"
pip install opentranslator
opentranslator --translate english --text "Ciao Mondo!"
Text from file
opentranslator --translate english --filepath examples/it.txt
Other
Arg -vvv: output all info with cost of request (in progress)
Dev mode
- Setup env
git clone https://github.com/FabrizioCafolla/chatgpt-translate-app.git
cd chatgpt-translate-app
echo 'export OPENAI_API_KEY="${YOUR_OPENAI_API_KEY}"' > .env
chmod +x scritps/*.sh
./scripts/setup.sh
source .activate
- Usage
python opentranslator/app.py --filepath examples/it.txt --translate english
python opentranslator/app.py --filepath examples/en.txt --translate italian
python opentranslator/app.py --text "Ciao Mondo!" --translate english
Contributors
License
The project is made available under the GPL-3.0 license. See the LICENSE file for more information.
Metadata
Release files for opentranslator 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opentranslator-0.0.1-py37-none-any.whl | Python 3.7 | none | any | Details for opentranslator-0.0.1-py37-none-any.whl |
Release files / opentranslator-0.0.1-py37-none-any.whl
| Download URL | opentranslator-0.0.1-py37-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3.7 |
|
SHA-256 checksum How to use checksums |
20099bdd0cf50f2dfd4743879d15fbc6d9b6987f8a1622f7f61d2fbb328bc29a
|
|
BLAKE2b-256 checksum How to use checksums |
d04864eecea52ae221abbb126de10415a735f914f8ebd5eaf6840783161c580f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.1
|
Security for opentranslator 0.0.1
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.