This project is a simple language translator built using Python and the deep_translator
library. It translates input text from a source language to a target language using an API (Google Translator in this case).
- Translate any text from one language to another
- Supports a wide variety of languages
- Simple and interactive input/output flow
- Easily extendable for use in other applications
- Python 3
- Jupyter Notebook
- deep-translator library
- Clone the repository
git clone https://github.com/your-username/basic-translator-using-api.git
cd basic-translator-using-api
- Install required packages
pip install deep-translator
- Run the notebook
You can run the Jupyter notebook using:
jupyter notebook Basic_Translator_Using_API.ipynb
-
Run all cells in the notebook.
-
You'll be prompted to:
- Enter the sentence you want to translate
- Specify the source language (e.g.,
en
for English) - Specify the target language (e.g.,
fr
for French)
-
The translated sentence will be printed in the output.
Enter a sentence: Hello, how are you?
Enter the source language: en
Enter the target language: es
Output:
Hola, ¿cómo estás?
The deep-translator
library supports many languages. You can refer to deep-translator documentation or list supported languages in the notebook via:
from deep_translator import GoogleTranslator
print(GoogleTranslator.get_supported_languages(as_dict=True))
This project is open-source and available under the MIT License.
Feel free to contribute or suggest improvements!