<!-- [![Contributors][contributors-shield]][contributors-url] -->
<!-- [![Forks][forks-shield]][forks-url] -->
<!-- [![Stargazers][stars-shield]][stars-url] -->
[![Downloads](https://static.pepy.tech/personalized-badge/transipy?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/transipy)
[![PyPI](https://img.shields.io/pypi/v/transipy)](https://pypi.org/project/transipy/)
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
<!-- PROJECT LOGO -->
<br />
<p align="center">
<a href="https://github.com/NeiH4207/transipy">
<img src="images/transipy_logo.jpeg" alt="Logo" width="180" height="180">
</a>
<h3 align="center">Transipy: The Powerful and Fastest Document Translation Tool</h3>
<p align="center">
Transipy is your one-stop solution for lightning-fast and accurate document translation. With its parallel processing capabilities, Transipy effortlessly handles large volumes of data in various formats, including CSV, TXT, DOCX, and XLSX.
<br />
<a href="https://github.com/NeiH4207/transipy"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://github.com/NeiH4207/transipy">View Demo</a>
·
<a href="https://github.com/NeiH4207/transipy/issues">Report Bug</a>
·
<a href="https://github.com/NeiH4207/transipy/issues">Request Feature</a>
</p>
</p>
<!-- TABLE OF CONTENTS -->
<details open="open">
<summary>Table of Contents</summary>
<ol>
<li>
<a href="#about-the-project">About The Project</a>
<ul>
<li><a href="#built-with">Built With</a></li>
</ul>
</li>
<li>
<a href="#getting-started">Getting Started</a>
<ul>
<li><a href="#installation">Installation</a></li>
</ul>
</li>
<li><a href="#usage">Usage</a></li>
<li><a href="#contributing">Contributing</a></li>
<li><a href="#license">License</a></li>
<li><a href="#contact">Contact</a></li>
</ol>
</details>
<!-- ABOUT THE PROJECT -->
## About The Project
Transipy is your one-stop solution for lightning-fast and accurate document translation. With its parallel processing capabilities, Transipy effortlessly handles large volumes of data in various formats, including CSV, TXT, and XLSX.
Key Features:
1. Fastest Speed: Experience the fastest document translation available, thanks to Transipy's parallel processing techniques.
2. Versatile Format Support: Seamlessly translate your documents in CSV, TXT, and XLSX formats, eliminating the need for manual conversions.
3. High Accuracy: Trust Transipy's powerful translation engine to deliver precise results, ensuring your message is conveyed accurately across languages.
Transform your document translation workflow with Transipy – the powerful, fast, and versatile solution you've been waiting for.
<!-- GETTING STARTED -->
## Getting Started
This is an example of how you may give instructions on setting up your project locally.
To get a local copy up and running follow these simple example steps.
### Installation
Install the required packages using the following command:
```bash
pip install transipy
```
You can also install from the git repository:
```bash
git clone git@github.com:NeiH4207/transipy.git
cd transipy
pip install -e .
```
<!-- USAGE EXAMPLES -->
## Usage
```bash
usage: transipy [-h] -f FILE_PATH [-l SEP] -s SOURCE -t TARGET [-c CHUNK_SIZE] [-o OUTPUT_FILE] [-d DICTIONARY] [--column COLUMN]
[--skip SKIP] [--sheet SHEET]
Translate text in a file (.csv/.txt) from source language to target language.
options:
-h, --help show this help message and exit
-f FILE_PATH, --file-path FILE_PATH
The source file path
-l SEP, --sep SEP The separator of the file [comma, tab, space,...]
-s SOURCE, --source SOURCE
Source language (e.g. en, vi)
-t TARGET, --target TARGET
target language (e.g. en, vi)
-c CHUNK_SIZE, --chunk-size CHUNK_SIZE
The chunk size for splitting the translation process
-o OUTPUT_FILE, --output-file OUTPUT_FILE
The output file path
-d DICTIONARY, --dictionary DICTIONARY
The dictionary file path, using for custom translation
--column COLUMN The column name to translate, separated by comma
--skip SKIP The column name to skip, separated by comma
--sheet SHEET The sheet name to translate, separated by comma
```
#### Translate a CSV file
Example:
```bash
transipy -f path_to_file.[csv, tsv, txt, xlsx, docx] -s <source> -t <target>
```
#### Translate a file with a dictionary
The dictionary file is a JSON file that contains the translation of the words.
The dictionary file should be in the following format (see examples/dictionary.json):
```json
{
"word_1": "translated_word_1",
"word_2": "translated_word_2",
}
```
Example, you have a dictionary file named "dictionary.json" and you want to translate specific columns ("Title" and "Summary") from a CSV file from English to Vietnamese. You can use the following command:
```bash
transipy -f path_to_file.csv -s en -t vi -d path_to/dictionary.json --column Title,Summary
```
Example input file:
```csv
| Title | Summary | Level 1 | Level 2 | Level 3 | Level 4 |
| ---------------- | ------------------------ | ------- | -------------- | -------------- | ------- |
| Stomach Cancer | Likelihood of Development | lower | slightly lower | slightly higher| higher |
| Colorectal Cancer| Likelihood of Development | lower | slightly lower | slightly higher| higher |
| Thyroid Cancer | Likelihood of Development | lower | slightly lower | slightly higher| higher |
| Lung Cancer | Likelihood of Development | lower | slightly lower | slightly higher| higher |
| Liver Cancer | Likelihood of Development | lower | slightly lower | slightly higher| higher |
```
Example output file:
```csv
| Title | Summary | Level 1 | Level 2 | Level 3 | Level 4 |
| ------------------ | ------------------------ | ------- | -------------- | -------------- | ------- |
| Ung thư dạ dày | Khả năng phát triển | lower | slightly lower | slightly higher| higher |
| Ung thư đại trực | Khả năng phát triển | lower | slightly lower | slightly higher| higher |
| Ung thư tuyến giáp | Khả năng phát triển | lower | slightly lower | slightly higher| higher |
| Ung thư phổi | Khả năng phát triển | lower | slightly lower | slightly higher| higher |
| Ung thư gan | Khả năng phát triển | lower | slightly lower | slightly higher| higher |
```
## BUGS:
- Error: `invalid syntax. Perhaps you forgot a comma?` - This error appears due to a bug from the current gg translate version. The problem is when the text contains certain words (for example "nullified") that will cause this.
- Error: `HTTPSConnectionPool(host='translate.googleapis.com', port=443): Max retries exceeded with url` - This error appears due to the limitation of the google translate API. The solution is to increase the `-c chunk_size` parameter to reduce the number of requests to the API in a short time.
<!-- CONTRIBUTING -->
## Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
<!-- LICENSE -->
## License
Distributed under the MIT License. See `LICENSE` for more information.
<!-- CONTACT -->
## Contact
Vũ Quốc Hiển - [@hienvq23](hienvq23@gmail.com) - hienvq23@gmail.com
Project Link: [https://github.com/Neih4207/transipy](https://github.com/Neih4207/transipy)
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[download-url]: https://github.com/NeiH4207/transipy/graphs/contributors
[contributors-shield]: https://img.shields.io/github/contributors/NeiH4207/transipy.svg?style=for-the-badge
[contributors-url]: https://github.com/NeiH4207/transipy/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/NeiH4207/transipy.svg?style=for-the-badge
[forks-url]: https://github.com/NeiH4207/transipy/network/members
[stars-shield]: https://img.shields.io/github/stars/NeiH4207/transipy.svg?style=for-the-badge
[stars-url]: https://github.com/NeiH4207/transipy/stargazers
[issues-shield]: https://img.shields.io/github/issues/NeiH4207/transipy.svg?style=for-the-badge
[issues-url]: https://github.com/NeiH4207/transipy/issues
[license-shield]: https://img.shields.io/github/license/NeiH4207/transipy.svg?style=for-the-badge
[license-url]: https://github.com/NeiH4207/transipy/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://www.linkedin.com/in/neihvq23/
[product-screenshot]: images/screenshot.png
Raw data
{
"_id": null,
"home_page": "https://github.com/NeiH4207/transipy",
"name": "transipy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "google translate, translation, document translation, language translation",
"author": "Hien Vu,",
"author_email": "hienvq23@gmail.com,",
"download_url": "https://files.pythonhosted.org/packages/48/5d/43ed5beacb00b18b447b82ded15a52955fe7bbcf3d6ef1bad72c3ca8184e/transipy-1.0.5.tar.gz",
"platform": null,
"description": "<!-- [![Contributors][contributors-shield]][contributors-url] -->\n<!-- [![Forks][forks-shield]][forks-url] -->\n<!-- [![Stargazers][stars-shield]][stars-url] -->\n[![Downloads](https://static.pepy.tech/personalized-badge/transipy?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/transipy)\n[![PyPI](https://img.shields.io/pypi/v/transipy)](https://pypi.org/project/transipy/)\n[![MIT License][license-shield]][license-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\n\n<!-- PROJECT LOGO -->\n<br />\n<p align=\"center\">\n <a href=\"https://github.com/NeiH4207/transipy\">\n <img src=\"images/transipy_logo.jpeg\" alt=\"Logo\" width=\"180\" height=\"180\">\n </a>\n\n <h3 align=\"center\">Transipy: The Powerful and Fastest Document Translation Tool</h3>\n\n <p align=\"center\">\n Transipy is your one-stop solution for lightning-fast and accurate document translation. With its parallel processing capabilities, Transipy effortlessly handles large volumes of data in various formats, including CSV, TXT, DOCX, and XLSX.\n <br />\n <a href=\"https://github.com/NeiH4207/transipy\"><strong>Explore the docs \u00bb</strong></a>\n <br />\n <br />\n <a href=\"https://github.com/NeiH4207/transipy\">View Demo</a>\n \u00b7\n <a href=\"https://github.com/NeiH4207/transipy/issues\">Report Bug</a>\n \u00b7\n <a href=\"https://github.com/NeiH4207/transipy/issues\">Request Feature</a>\n </p>\n</p>\n\n\n\n<!-- TABLE OF CONTENTS -->\n<details open=\"open\">\n <summary>Table of Contents</summary>\n <ol>\n <li>\n <a href=\"#about-the-project\">About The Project</a>\n <ul>\n <li><a href=\"#built-with\">Built With</a></li>\n </ul>\n </li>\n <li>\n <a href=\"#getting-started\">Getting Started</a>\n <ul>\n <li><a href=\"#installation\">Installation</a></li>\n </ul>\n </li>\n <li><a href=\"#usage\">Usage</a></li>\n <li><a href=\"#contributing\">Contributing</a></li>\n <li><a href=\"#license\">License</a></li>\n <li><a href=\"#contact\">Contact</a></li>\n </ol>\n</details>\n\n\n\n<!-- ABOUT THE PROJECT -->\n## About The Project\n\nTransipy is your one-stop solution for lightning-fast and accurate document translation. With its parallel processing capabilities, Transipy effortlessly handles large volumes of data in various formats, including CSV, TXT, and XLSX.\n\nKey Features:\n\n1. Fastest Speed: Experience the fastest document translation available, thanks to Transipy's parallel processing techniques.\n2. Versatile Format Support: Seamlessly translate your documents in CSV, TXT, and XLSX formats, eliminating the need for manual conversions.\n3. High Accuracy: Trust Transipy's powerful translation engine to deliver precise results, ensuring your message is conveyed accurately across languages.\n\nTransform your document translation workflow with Transipy \u2013 the powerful, fast, and versatile solution you've been waiting for.\n\n<!-- GETTING STARTED -->\n## Getting Started\n\nThis is an example of how you may give instructions on setting up your project locally.\nTo get a local copy up and running follow these simple example steps.\n\n### Installation\n\nInstall the required packages using the following command:\n\n```bash\npip install transipy\n```\n\nYou can also install from the git repository:\n\n```bash\ngit clone git@github.com:NeiH4207/transipy.git\ncd transipy\npip install -e .\n```\n\n<!-- USAGE EXAMPLES -->\n## Usage\n\n```bash\nusage: transipy [-h] -f FILE_PATH [-l SEP] -s SOURCE -t TARGET [-c CHUNK_SIZE] [-o OUTPUT_FILE] [-d DICTIONARY] [--column COLUMN]\n [--skip SKIP] [--sheet SHEET]\n\nTranslate text in a file (.csv/.txt) from source language to target language.\n\noptions:\n -h, --help show this help message and exit\n -f FILE_PATH, --file-path FILE_PATH\n The source file path\n -l SEP, --sep SEP The separator of the file [comma, tab, space,...]\n -s SOURCE, --source SOURCE\n Source language (e.g. en, vi)\n -t TARGET, --target TARGET\n target language (e.g. en, vi)\n -c CHUNK_SIZE, --chunk-size CHUNK_SIZE\n The chunk size for splitting the translation process\n -o OUTPUT_FILE, --output-file OUTPUT_FILE\n The output file path\n -d DICTIONARY, --dictionary DICTIONARY\n The dictionary file path, using for custom translation\n --column COLUMN The column name to translate, separated by comma\n --skip SKIP The column name to skip, separated by comma\n --sheet SHEET The sheet name to translate, separated by comma\n```\n\n#### Translate a CSV file\n\nExample:\n```bash\ntransipy -f path_to_file.[csv, tsv, txt, xlsx, docx] -s <source> -t <target>\n```\n\n#### Translate a file with a dictionary\n\nThe dictionary file is a JSON file that contains the translation of the words. \nThe dictionary file should be in the following format (see examples/dictionary.json):\n\n```json\n{\n \"word_1\": \"translated_word_1\",\n \"word_2\": \"translated_word_2\",\n}\n```\n\nExample, you have a dictionary file named \"dictionary.json\" and you want to translate specific columns (\"Title\" and \"Summary\") from a CSV file from English to Vietnamese. You can use the following command:\n\n```bash\ntransipy -f path_to_file.csv -s en -t vi -d path_to/dictionary.json --column Title,Summary\n```\n\nExample input file:\n```csv\n| Title | Summary | Level 1 | Level 2 | Level 3 | Level 4 |\n| ---------------- | ------------------------ | ------- | -------------- | -------------- | ------- |\n| Stomach Cancer | Likelihood of Development | lower | slightly lower | slightly higher| higher |\n| Colorectal Cancer| Likelihood of Development | lower | slightly lower | slightly higher| higher |\n| Thyroid Cancer | Likelihood of Development | lower | slightly lower | slightly higher| higher |\n| Lung Cancer | Likelihood of Development | lower | slightly lower | slightly higher| higher |\n| Liver Cancer | Likelihood of Development | lower | slightly lower | slightly higher| higher |\n\n```\n\nExample output file:\n```csv\n| Title | Summary | Level 1 | Level 2 | Level 3 | Level 4 |\n| ------------------ | ------------------------ | ------- | -------------- | -------------- | ------- |\n| Ung th\u01b0 d\u1ea1 d\u00e0y | Kh\u1ea3 n\u0103ng ph\u00e1t tri\u1ec3n | lower | slightly lower | slightly higher| higher |\n| Ung th\u01b0 \u0111\u1ea1i tr\u1ef1c | Kh\u1ea3 n\u0103ng ph\u00e1t tri\u1ec3n | lower | slightly lower | slightly higher| higher |\n| Ung th\u01b0 tuy\u1ebfn gi\u00e1p | Kh\u1ea3 n\u0103ng ph\u00e1t tri\u1ec3n | lower | slightly lower | slightly higher| higher |\n| Ung th\u01b0 ph\u1ed5i | Kh\u1ea3 n\u0103ng ph\u00e1t tri\u1ec3n | lower | slightly lower | slightly higher| higher |\n| Ung th\u01b0 gan | Kh\u1ea3 n\u0103ng ph\u00e1t tri\u1ec3n | lower | slightly lower | slightly higher| higher |\n```\n\n## BUGS:\n- Error: `invalid syntax. Perhaps you forgot a comma?` - This error appears due to a bug from the current gg translate version. The problem is when the text contains certain words (for example \"nullified\") that will cause this.\n- Error: `HTTPSConnectionPool(host='translate.googleapis.com', port=443): Max retries exceeded with url` - This error appears due to the limitation of the google translate API. The solution is to increase the `-c chunk_size` parameter to reduce the number of requests to the API in a short time.\n\n<!-- CONTRIBUTING -->\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n\n<!-- LICENSE -->\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\n\n<!-- CONTACT -->\n## Contact\n\nV\u0169 Qu\u1ed1c Hi\u1ec3n - [@hienvq23](hienvq23@gmail.com) - hienvq23@gmail.com\n\nProject Link: [https://github.com/Neih4207/transipy](https://github.com/Neih4207/transipy)\n\n\n<!-- MARKDOWN LINKS & IMAGES -->\n<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->\n[download-url]: https://github.com/NeiH4207/transipy/graphs/contributors\n[contributors-shield]: https://img.shields.io/github/contributors/NeiH4207/transipy.svg?style=for-the-badge\n[contributors-url]: https://github.com/NeiH4207/transipy/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/NeiH4207/transipy.svg?style=for-the-badge\n[forks-url]: https://github.com/NeiH4207/transipy/network/members\n[stars-shield]: https://img.shields.io/github/stars/NeiH4207/transipy.svg?style=for-the-badge\n[stars-url]: https://github.com/NeiH4207/transipy/stargazers\n[issues-shield]: https://img.shields.io/github/issues/NeiH4207/transipy.svg?style=for-the-badge\n[issues-url]: https://github.com/NeiH4207/transipy/issues\n[license-shield]: https://img.shields.io/github/license/NeiH4207/transipy.svg?style=for-the-badge\n[license-url]: https://github.com/NeiH4207/transipy/blob/master/LICENSE.txt\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555\n[linkedin-url]: https://www.linkedin.com/in/neihvq23/\n[product-screenshot]: images/screenshot.png\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Transipy is your one-stop solution for lightning-fast and accurate document translation.",
"version": "1.0.5",
"project_urls": {
"Homepage": "https://github.com/NeiH4207/transipy"
},
"split_keywords": [
"google translate",
" translation",
" document translation",
" language translation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "92a3dc949aeb8689a24589fce44fec5669df61f1079cfab111591fb6b3ce294e",
"md5": "f8f6ef0e4071bac4ab9a86a5ac67a0df",
"sha256": "6ec72d54272d3cef1dd41cbb440224b894119b970039da30af43230a922419d4"
},
"downloads": -1,
"filename": "transipy-1.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f8f6ef0e4071bac4ab9a86a5ac67a0df",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 10091,
"upload_time": "2024-07-04T04:32:53",
"upload_time_iso_8601": "2024-07-04T04:32:53.266990Z",
"url": "https://files.pythonhosted.org/packages/92/a3/dc949aeb8689a24589fce44fec5669df61f1079cfab111591fb6b3ce294e/transipy-1.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "485d43ed5beacb00b18b447b82ded15a52955fe7bbcf3d6ef1bad72c3ca8184e",
"md5": "15fd29a5278862a3c96a3a513857b1e9",
"sha256": "0b712e04d20c054c4127ddf193e90f7aa80dfcfdbabda441f673ff290fbe79ed"
},
"downloads": -1,
"filename": "transipy-1.0.5.tar.gz",
"has_sig": false,
"md5_digest": "15fd29a5278862a3c96a3a513857b1e9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 11361,
"upload_time": "2024-07-04T04:32:54",
"upload_time_iso_8601": "2024-07-04T04:32:54.824177Z",
"url": "https://files.pythonhosted.org/packages/48/5d/43ed5beacb00b18b447b82ded15a52955fe7bbcf3d6ef1bad72c3ca8184e/transipy-1.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-04 04:32:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "NeiH4207",
"github_project": "transipy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "loguru",
"specs": [
[
"==",
"0.7.2"
]
]
},
{
"name": "googletrans",
"specs": [
[
"==",
"4.0.0rc1"
]
]
},
{
"name": "pandas",
"specs": []
},
{
"name": "bottleneck",
"specs": []
},
{
"name": "openpyxl",
"specs": [
[
"==",
"3.1.2"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.31.0"
]
]
},
{
"name": "h2",
"specs": [
[
"==",
"3.2.0"
]
]
},
{
"name": "httpx",
"specs": [
[
"==",
"0.13.3"
]
]
},
{
"name": "python-docx",
"specs": []
},
{
"name": "pytest",
"specs": []
}
],
"lcname": "transipy"
}