Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabriziocafolla/openai-chatgpt-opentranslator
Python command that uses openai to perform text translations
https://github.com/fabriziocafolla/openai-chatgpt-opentranslator
chatgpt chatgpt-api chatgpt-python chatgpt3 openai openai-api python-translator python3
Last synced: 2 months ago
JSON representation
Python command that uses openai to perform text translations
- Host: GitHub
- URL: https://github.com/fabriziocafolla/openai-chatgpt-opentranslator
- Owner: FabrizioCafolla
- License: gpl-3.0
- Created: 2023-01-10T19:07:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-01T17:05:29.000Z (over 1 year ago)
- Last Synced: 2024-10-17T12:27:45.220Z (3 months ago)
- Topics: chatgpt, chatgpt-api, chatgpt-python, chatgpt3, openai, openai-api, python-translator, python3
- Language: Python
- Homepage: https://pypi.org/project/opentranslator/
- Size: 26.4 KB
- Stars: 28
- Watchers: 4
- Forks: 13
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# 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
- **[Fabrizio Cafolla](https://github.com/FabrizioCafolla)**
### 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
1. Setup env
```
git clone https://github.com/FabrizioCafolla/chatgpt-translate-app.gitcd chatgpt-translate-app
echo 'export OPENAI_API_KEY="${YOUR_OPENAI_API_KEY}"' > .env
chmod +x scritps/*.sh
./scripts/setup.sh
source .activate
```2. Usage
```
python opentranslator/app.py --filepath examples/it.txt --translate englishpython 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.