Trasn is a Python API for dealing with word translations Eng/Spa. Available online here ready to be used for free with Postman or similar solution
Use the package manager pip to install Trasnapp.
pip install -r requirements.txt
After installing the requirements, modified the config file credentials to access Mongo DB, then just follow this steps:
set FLASK_APP=main.py
flask run
To translate words from english to spanish use this endpoint:
#https://trasnapp.herokuapp.com/main/translate
POST /main/translate HTTP/1.1
Host: trasnapp.herokuapp.com
Content-Type: application/json
{
"word": "nothing",
"lang": "en"
}
To translate words from spanish to english use this endpoint:
#https://trasnapp.herokuapp.com/main/translate
POST /main/translate HTTP/1.1
Host: trasnapp.herokuapp.com
Content-Type: application/json
{
"word": "casa",
"lang": "es"
}
To add new translations from english to spanish use this endpoint:
#https://trasnapp.herokuapp.com/main/add
POST /main/add HTTP/1.1
Host: trasnapp.herokuapp.com
Content-Type: application/json
{
"word": "nothing",
"lang": "en",
"transl": "nada"
}
To translate words from spanish to english use this endpoint:
#https://trasnapp.herokuapp.com/main/add
POST /main/translate HTTP/1.1
Host: trasnapp.herokuapp.com
Content-Type: application/json
{
"word": "home",
"lang": "en",
"transl": "casa"
}
To remove translations in english use this endpoint:
#https://trasnapp.herokuapp.com/main/remove
POST /main/remove HTTP/1.1
Host: trasnapp.herokuapp.com
Content-Type: application/json
{
"word": "nothing",
"lang": "en"
}
To translate words in spanish use this endpoint:
#https://trasnapp.herokuapp.com/main/remove
POST /main/remove HTTP/1.1
Host: trasnapp.herokuapp.com
Content-Type: application/json
{
"word": "nada",
"lang": "es"
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.