Hello! This is an experimental web project (that is, it runs exclusively on the locale). Its essence is to calculate the rating of football players in the strongest leagues based on their performance. It is worth noting that the project is divided into two micro-services (I am a contributor to both). The second one collected data and sent it using requests second micro-service
- programming language Python3 and its libraries:
- Web framework Flask
- Library for parsing data from the necessary sites Soccerdata
- sql toolkit SQLAlchemy
- Splitting a project into microservices using requests
- Creating high-quality gitignore, requirements.txt , config. Teamwork (2 more people contributed to this project, who are contributors in github repo and partially helped in the implementation of my idea), which has been simplified with the help of the above points.
- The player classes are created using sqlalchemy.orm. Polymorphism was used, including polymorphism for tables that are directly related to player classes
- The architecture of the project. Blueprint and cli are used. The whole project is divided into understandable blocks and meets many development standards.
- Marshmallow was used in conjunction with flask and sqlalchemy, which proved to be an good solution.
- Migrations were used to control the versions of the database, which constantly needs to be updated using requests from the second microservice
- Firstly, it was necessary to get data about football players, for this I used soccerdata, which provided data from the FBref website, example of data I received
- Next, I need to create models for position. To do this, I created a universal pattern, which I used to create all positions, and the signs were inherited using polymorphism, also for each position a separate table was created, inherited from the main one with all the players. Migrations were also used for version control. This is what the example of the main table and their system looked like:
- To calculate the score of the players, I used a weighted average, and the weights themselves were constants set manually (different for each position). Moreover, the main weighted average value for the position was calculated relative to other weighted averages logically grouped.
- The final site looks like this: