{ "info": { "author": "Mitsuki Ogasahara", "author_email": "negiga@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12" ], "description": "# ailingo: A CLI tool for translating local files using generative AI (LLM)\n\n**ailingo** is a command-line interface (CLI) tool that uses generative AI to translate local files into various languages.\n\n
\n\n\n English |\n \u65e5\u672c\u8a9e |\n \u7b80\u4f53\u4e2d\u6587 |\n \u7e41\u4f53\u4e2d\u6587 |\n Espa\u00f1ol\n
\n\n## Overview\n\nIt is designed to enable developers, translators, and content creators to efficiently localize their files.\n\n**Key Features:**\n\n- **Flexible file handling:** Translate multiple files at once.\n- **Wide language support:** Freely specify the source and target languages.\n- **Generative AI model selection:** Choose from various generative AI models available through litellm, including ChatGPT, Gemini, and Anthropic.\n- **Customizable output:** Control the names and save locations of translated files.\n- **Adding translation requests**: Add requests for nuances in translation, such as casual tone.\n- **Rewrite mode**: Rewrite text in the same language with spelling/grammar correction or adjust the writing style as requested.\n- **Editor mode**: Translate text directly in an editor.\n- **URL mode**: Download and translate a web page. \n\n## Installation\n\n### Prerequisites:\n\n- Python 3.11\n\n## Quick Start:\n\n```bash\nexport OPENAI_API_KEY=\"YOUR_OPENAI_API_KEY\"\npip install ailingo\nailingo my_document.txt --target ja\n```\n\n### Detailed setup procedure:\n\n#### 1. Setting up litellm:\n\nThis program uses LiteLLM to access generative AI. LiteLLM is designed to work with a variety of providers. Please create an account with the provider of the generative AI model you wish to use, and obtain an API key.\n\nPlease refer to the [LiteLLM documentation](https://docs.litellm.ai/docs/providers) for detailed setup instructions. Here are some examples of setting up typical API keys:\n\n```bash\n# Default: OpenAI (gpt-4o, etc.)\nexport OPENAI_API_KEY=\"YOUR_OPENAI_API_KEY\"\n\n# VertexAI (Gemini, etc.)\n# Run `gcloud auth application-default login` or set `GOOGLE_APPLICATION_CREDENTIALS`\nexport VERTEXAI_PROJECT=\"your-google-project-id\"\nexport VERTEXAI_LOCATION=\"us-central1\"\n\n# Anthropic (haiku, opus, sonnet, etc.)\nexport ANTHROPIC_API_KEY=\"YOUR_ANTHROPIC_API_KEY\"\n```\n\n#### 2. Installing ailingo:\n\n```bash\npip install ailingo\n# If you want to use VertexAI (Gemini etc.)\npip install 'ailingo[google]'\n# If you want to use AWS (Bedrock)\npip install 'ailingo[aws]'\n# Or install all dependencies\npip install 'ailingo[all]'\n```\n\n## Usage\n\n### Basic translation:\n\n```bash\nailingo