API for FinLand android app made using Flask. HackerEarth BTS Hackathon
Make sure you have python3.6
installed in your machine before you continue. For windows users, the path to python3.6
must be added to the system environment variable PATH
.
Install virtualenv in python. pip3 install virtualenv
$ virtualenv -p python3 venv
This will create a virtual environment named venv with python3 as its interpreter.
If you have multiple versions of python installed and added to PATH
follow the following steps.
> where python
C:\Python27\python.exe
C:\Users\deepd\AppData\Local\Programs\Python\Python37-32\python.exe
C:\Users\deepd\AppData\Local\Programs\Python\Python36\python.exe
You will get an output of all the python execuables that are added to PATH
. For example I have python2.7
, python3.6
and python3.7
installed.
Use the path of python3.6
to create the virtual environment.
> virtualenv -p C:\Users\deepd\AppData\Local\Programs\Python\Python36\python.exe venv
$ source venv/bin/activate
(venv) ...$
> venv\Scripts\activate
(venv) ...>
You can either install requirements from the requirements.txt file but using the command
pip install -r requirements.txt
Run the api.py file to start the API server.
python api.py
On success
{
"land-type": "Herbaceous Vegetation",
"probability": "100.0 %",
"status": "success",
"status-code": 1,
"time-taken": 1.6259400844573975
}
On failure
{
"land-type": null,
"probability": null,
"status": "failure",
"status-code": 0,
"time-taken": -1
}