Football-money

Description

The aim of the task is to create a simple web service that implements a certain complex functionality based on open services providing REST APIs. Create a service that:

Source: Python/Football-money

Solution

I utilized the following APIs:

Without API_KEY: (For finding the most expensive football player)

With API_KEY:

(For converting Euro to PLN at player value)

Therefore, in the .env file, there are API_KEYs for these services.

In my solution, there are two forms, one allowing to search for the most expensive football player in a given team, and the other allowing to convert Euro amount to PLN. I did it this way because I had a problem with the API fetching the player, as it was not working for a certain period. That’s why I made the second form, which allows to convert Euro amount to PLN, to have some backup solution.

App appearance

.

How to start?

The API_KEYs for these services are in the .env file. Of course, to make the application work properly, you need to add your keys there. Similarly, you need to provide the api_key for the API itself in main.py. Different keys are in the api_key.txt file. You should use one of them to be able to use the application.

To run:

uvicorn main:app –reload –port 8002

You can change the port number to another.