This package is used to translate csv files across different languages. It uses the Google Translate API to translate the csv files from a source language to a target language. Supported languages are listed here. The package can handle csv files with multiple columns and rows and can translate the whole file in one go, saving your time and effort.
pip install csv-transYou can use the package in two ways:
- Using the command line interface (CLI)
- Using the import utility in your python code.
Both the CLI and the import utility take the same arguments. The only difference is that the CLI takes the arguments as command line arguments while the import utility takes the arguments as function arguments. The arguments are listed below.
--fileor-f: The path to the source csv file.--source_languageor-sl: The source language of the csv file.--target_languageor-tl: The target language of the csv file.--sepor-s: The separator used in the csv file.
from csv_trans import translate
translate(file, source_language, target_language, sep=',')- Open the CLI and install the package
- Use the below command
csv_trans -f <file_name> -sl <source_language> -tl <target_language> -fs <file_seperator>Saeed Ahmad 💻 📖 |
Izhar Ali 💻📖 |
Shaharyar Sajid 💻 |