Technical tests done for the company Tangelo.
This project is built in Python and uses the following libraries:
This is an application that consumes a service exposed by Rest Countries, then filters the information according to the requested requirements. It uses Pandas DataFrame to manipulate the information in a proper way, calculates time measurements and finally connects to a database and records the execution times. If the database or the table does not exist, it is created, additionally the app saves the data table in the DB in JSON format.
Below is the design of the solution:
SHA1 encryption is not recommended for new designs, even in its own page it says so, I was investigating new methods and I found Fernet (symmetric encryption): Fernet guarantees that an encrypted message cannot be manipulated or read without the key.
With this update, the board looks like this:
The program needs git to clone it and python to run it.
Installation is really simple
- Clone the repository
Enter the folder
git clone https://github.com/jsdnlb/tangelo-challenge
cd tangelo-challenge/
- Create the virtual environment
And then active the virtual environment
python3 -m venv venv
source venv/bin/activate
- Build the application, this was implemented to do the unit tests.
pip install -e .
- Install the dependencies
requirements.txt
pip install -r requirements.txt
To run the application you only have to run the file as follows:
python3 app/bin/run.py
The answer will be similar to the following, depending on the quality of your internet.
This is an example of the data saved by the app using SQLite and visualized in Visual Studio Code with the SQLite Viewer extension.
To use the unit tests you only have to run the files that are in the test
folder, for example I will show the tests for encryption:
# SHA1 method:
python3 app/test/test_encrypt_sha1.py
# Fernet method:
python3 app/test/test_encrypt_fernet.py
This is the result:
Distributed under the MIT License. See LICENSE.txt
for more information.