# 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)** <a href="https://www.buymeacoffee.com/fabriziocafolla" target="_blank"><img align="right" src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 30px !important; width: 150px !important" ></a>
### 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.git
cd 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 english
python opentranslator/app.py --filepath examples/en.txt --translate italian
python opentranslator/app.py --text "Ciao Mondo!" --translate english
```
### Contributors
<a href="https://github.com/fabriziocafolla/opentranslator/graphs/contributors"> <img src="https://contrib.rocks/image?repo=fabriziocafolla/opentranslator" /> </a>
### License
The project is made available under the GPL-3.0 license. See the `LICENSE` file for more information.
Raw data
{
"_id": null,
"home_page": "https://github.com/fabriziocafolla/opentranslator",
"name": "opentranslator",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "FabrizioCafolla",
"author_email": "developer@fabriziocafolla.com",
"download_url": "",
"platform": null,
"description": "# Opentranslator - OpenAI | ChatGPT | Translate with python\n\nOpentranslator 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.\n\nThe following project was born to study OpenAI and how it works.\nIf you would contribute open a pull request or issue on GitHub.\n\n### Mantained by\n\n- **[Fabrizio Cafolla](https://github.com/FabrizioCafolla)** <a href=\"https://www.buymeacoffee.com/fabriziocafolla\" target=\"_blank\"><img align=\"right\" src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 30px !important; width: 150px !important\" ></a>\n\n### Usage\n\n#### Required\n\n- Python >= 3.7\n- OpenAI Account\n\n\n#### Input text\n```\n# You can save your OPENAI_API_KEY permanently in the user's environment\nexport OPENAI_API_KEY=\"${YOUR_OPENAI_API_KEY}\"\n\npip install opentranslator\n\nopentranslator --translate english --text \"Ciao Mondo!\"\n```\n\n#### Text from file\n\n```\nopentranslator --translate english --filepath examples/it.txt\n```\n\n#### Other\n\n```\nArg -vvv: output all info with cost of request (in progress)\n```\n\n### Dev mode\n\n1. Setup env\n\n```\ngit clone https://github.com/FabrizioCafolla/chatgpt-translate-app.git\n\ncd chatgpt-translate-app\n\necho 'export OPENAI_API_KEY=\"${YOUR_OPENAI_API_KEY}\"' > .env\n\nchmod +x scritps/*.sh\n\n./scripts/setup.sh\n\nsource .activate\n```\n\n2. Usage\n\n```\npython opentranslator/app.py --filepath examples/it.txt --translate english\n\npython opentranslator/app.py --filepath examples/en.txt --translate italian\n\npython opentranslator/app.py --text \"Ciao Mondo!\" --translate english\n```\n\n### Contributors\n\n<a href=\"https://github.com/fabriziocafolla/opentranslator/graphs/contributors\"> <img src=\"https://contrib.rocks/image?repo=fabriziocafolla/opentranslator\" /> </a>\n\n### License\n\nThe project is made available under the GPL-3.0 license. See the `LICENSE` file for more information.\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Python client library for translate text with OpenAI API",
"version": "0.0.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d04864eecea52ae221abbb126de10415a735f914f8ebd5eaf6840783161c580f",
"md5": "e6e07526bc70e4936e5feabf32cab16c",
"sha256": "20099bdd0cf50f2dfd4743879d15fbc6d9b6987f8a1622f7f61d2fbb328bc29a"
},
"downloads": -1,
"filename": "opentranslator-0.0.1-py37-none-any.whl",
"has_sig": false,
"md5_digest": "e6e07526bc70e4936e5feabf32cab16c",
"packagetype": "bdist_wheel",
"python_version": "py37",
"requires_python": ">=3.7",
"size": 16836,
"upload_time": "2023-01-12T10:30:24",
"upload_time_iso_8601": "2023-01-12T10:30:24.959618Z",
"url": "https://files.pythonhosted.org/packages/d0/48/64eecea52ae221abbb126de10415a735f914f8ebd5eaf6840783161c580f/opentranslator-0.0.1-py37-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-12 10:30:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "fabriziocafolla",
"github_project": "opentranslator",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "opentranslator"
}