Skip to content

cedricrabarijohn/Python-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌐 Python-translator 🌐

🔥💯 V2 now supports multiple translations 💯🔥

Description

A light python api written with fastapi to translate your text. Fork this repository if you want to use it on your local environment. Otherwise, you can try out the deployed url https://python-translator.herokuapp.com

Prerequisites

Packages

- fastapi
- translators
- uvicorn

Run the script

> uvicorn module.main:app --reload

Usage

⭐⭐ V2 ⭐⭐

✅ Url

localhost:8000

or

https://python-translator.herokuapp.com

✅ EndPoint

/v2/translate

✅ Method

POST

✅ Request body (raw json)

{
  "texts": {
    "text1": "The first text to translate",
    "text2": "the second text to translate",
    "randomFieldName": "the third text to translate",
    "helloworld": "font icons for all projects, large or small"
  },
  "to_language": "fr"
}

✅ Response (status 200)

{
  "from_language": "auto",
  "to_language": "fr",
  "translated": {
    "text1": "Le premier texte à traduire",
    "text2": "Le deuxième texte à traduire",
    "randomFieldName": "Le troisième texte à traduire",
    "helloworld": "icônes de police pour tous les projets, grands ou petits"
  }
}

⭐⭐ V1 ⭐⭐

✅ Url

localhost:8000

or

https://python-translator.herokuapp.com

✅ EndPoint

/v1/translate

✅ Method

POST

✅ Request body (raw json)

{
  "text": "Wikipedia provides all its content for free, without advertising, and without using the exploitation of the personal data of its users.",
  "to_language": "fr"
}

✅ Response (status 200)

{
  "from_language": "auto",
  "to_language": "fr",
  "translated": "Wikipedia fournit tout son contenu gratuitement, sans publicité, et sans utiliser l'exploitation des données personnelles de ses utilisateurs."
}

Deployed api

About

A python api to translate your text written with fastapi

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published