Skip to main content

Transipy is your one-stop solution for lightning-fast and accurate document translation.

Project description

MIT License LinkedIn


Logo

Transipy: The Powerful and Fastest Document Translation Tool

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.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact

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

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:

pip install transipy

You can also install from the git repository:

git clone git@github.com:NeiH4207/transipy.git
cd transipy
pip install -e .

Usage

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:

transipy -f path_to_file.[csv, tsv, txt, xlsx] -s en -t vi

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):

{
    "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:

transipy -f path_to_file.csv -s en -t vi -d path_to/dictionary.json --column Title,Summary

Example input file:

| 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:

| 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

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

Distributed under the MIT License. See LICENSE for more information.

Contact

Vũ Quốc Hiển - @hienvq23 - hienvq23@gmail.com

Project Link: https://github.com/Neih4207/transipy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

transipy-1.0.3.tar.gz (11.5 kB view hashes)

Uploaded Source

Built Distribution

transipy-1.0.3-py3-none-any.whl (11.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page