Skip to main content

A package for perform unlimited machine translation via batches

Project description

Unlimited Machine Translator

Latest Release License Wheel Powered by deep-translator Status Downloads

Introducing the Unlimited Machine Translator, a Python package that enables you to translate all your data frames and doc files without restrictions! This powerful tool is designed for translating large datasets using the Google Translate API and is powered by the deep-translator library. The unlimited_machine_translation package offers automatic language detection, ensuring accurate translations for your content. Additionally, it removes translation limits by processing data in batches, making it an ideal solution for handling extensive data sets.

Installation

To install the Unlimited Machine Translator, run the following commands

  1. Install from PyPI:
pip install unlimited-machine-translator
  1. Install the latest version from the GitHub repository:
pip install git+https://github.com/Axel-Vs/unlimited_machine_translator.git

Features

  • Translate entire data frames with ease
  • Supports multiple translation APIs
  • Handles API limitations and restrictions by translating data in batches
  • Automatic language detection
  • Easily extendable to support new translation services

Usage

After installing the package, you can use it in your Python scripts or Jupyter notebooks like this:

Data Frame Translation Example

import os
import pandas as pd
from deep_translator import GoogleTranslator
from unlimited_machine_translator.translator import machine_translator_df

# Load your dataset
data = pd.read_csv("your_dataset.csv")

# Translate the desired column
translated_data = machine_translator_df(data_set=data, column_name="text_column", target_language="en", 
                                        source_language='auto', Translator=GoogleTranslator, 
                                        current_wd=os.getcwd())

# Save the translated data
translated_data.to_csv("translated_dataset.csv", index=False)

Document Translation Example

import os
from deep_translator import GoogleTranslator
from unlimited_machine_translator.translator import (
    read_word_document,
    machine_translator_doc,
    save_text_to_docx
)

# Load your text
text = read_word_document(os.getcwd(), "your_book.docx")

# Translate the information
translated_text = machine_translator_doc(text, target_language='es', source_language='auto', 
                                         Translator=GoogleTranslator, current_wd=os.getcwd())

# Store the translation
save_text_to_docx(os.getcwd(), translated_text, "translated_book.docx")

For additional examples and use cases, please refer to the "test_codes" directory in the repository.

Supported Translation APIs

Currently, the Unlimited Machine Translator primarily supports Google Translate API. In the future, it will be extended to support other translation services, such as:

  • DeepL Translator
  • Microsoft Translator
  • Yandex.Translate

Contributions

Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue on the https://github.com/Axel-Vs/unlimited_machine_translator.

License

This project is licensed under the MIT License. For more information, see the LICENSE file.

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

unlimited_machine_translator-1.1.4.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file unlimited_machine_translator-1.1.4.tar.gz.

File metadata

File hashes

Hashes for unlimited_machine_translator-1.1.4.tar.gz
Algorithm Hash digest
SHA256 3709787f66f0d03902e45dbdbc1d06a5fe840190dbd8b6843ea1490ee5fe2fc3
MD5 416f97ee93169d33afb420eddc94e603
BLAKE2b-256 ece21e9ccca08552ffd6a1683e51d726dcf6524cd8bd69197d1ad61193f5341d

See more details on using hashes here.

File details

Details for the file unlimited_machine_translator-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for unlimited_machine_translator-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 dbef660b9a78000355e464b873e02e07912feb52ae95ab8772ce96e8250698a6
MD5 9722045bade6e898deb6b61948fac9df
BLAKE2b-256 7f2c2d5c3c8265cf7a069afc08c5688f5735453bf10680f6e55a34e685de457b

See more details on using hashes here.

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