Python program with a timeframe input that loads JSON file(s) and creates a new one based on the timeframe. In other words: A Python program that turns MMA-fighters data to stats data based on the timeframe.
Budget: $30 – $250 USD
So I have multiple JSON files (each file represents a country of fighters) with MMA fighters from all around the world. The file structure in the JSON-files are generally the same, but some of the fighters have more data than others. The goal of the project is that your program can take in a timeframe and then either take one JSON file or multiple JSON files and create stats based on the timeframe and divide files into sub-categories based on their weight class, then that file will create sub-files based on specific values.
The number of fighters per stat will be 20 best fighters for that stat.
The stats that the program has to produce is:
-Most wins
-Most fights
-Most wins by knockouts
-Most wins by submissions
-Most wins by decisions
-Most wins in the first round
-Most wins in the second round
-Most wins in the third round
-Longest current streak(which is found in details, but one of their matches has to be present in the current time frame)
Example: so for most wins, it will be the top 20 fighters with most wins. For most fights, it will be the top 20 fighters with most fights and so on.
All these stats will be based on the timeframe determined by the date (for example, the last 12 months). And to calculate that date you have to use all the fighter's matches inside that timeframe.
Example: For most fights in the last 12 months - you have to calculate how many fights a fighter has had in the last 12 months.
Then we have the sub-categories which are their weight class. If I, for example, use the file with all the Norwegian fighters the program has to produce the stats (top 20 per stat) as stated above for all the weight classes together (no filtering for weight class), but it also has to create them separately for all the weight classes (filtered by their weight classes).
The weight classes are:
-Flyweight
-Bantamweight
-Featherweight
-Lightweight
-Welterweight
-Middleweight
-Light heavyweight
-Heavyweight
Their weight class for each fighter can be found in the child weigh_class which is under the parent details. If the value of that key is also null you can use the last match of the fighter, because it also has the keyword weight_class. If the value of that key is also null, you skip that fighter when creating data for the separate weight classes, but include that fighter when the first category is created, which represents all weight classes as stated earlier.
Then there are the sub-files.
The sub-files will be based on:
-Gender
-if the matches the fighter has fought are either pro or amateur
So if I give the program a JSON file with all the Norwegian fighters, the program has to do all the things stated above and then create new files which will be first based on gender. Then the files that are based on gender will be divided again for pro or amateur.
The gender part is simple. For example, when using the JSON file with Norwegian fighters you will produce the top 20 fighters for each stat, then the top 20 fighters for each stat, but for each weight class. Then do the same thing but now it is the top 20 for females and top 20 for males and then the top 20 for the weight class of each gender.
The pro or amateur part is harder because the pro or amateur is not based on if they are pro at the current moment, but on their matches in the current time frame. For example: if a fighter has fought 11 fights in the last 12 months and 10 of his fights are amateur and 1 is pro, his stat in the first file is 11, but when divided by pro or amateur his fights in the last 12 months in the pro-file will then be 1 and in the amateur-file be 10.
You also don't have to make the changing of the time frame super easy, just changeable, since I program in Swift and I make some web-scraping scripts in Python myself.
Feel free to ask me questions. I will also leave files with the structure of the program and the JSON files you will be working with.
The number of fighters per stat will be 20 best fighters for that stat.
The stats that the program has to produce is:
-Most wins
-Most fights
-Most wins by knockouts
-Most wins by submissions
-Most wins by decisions
-Most wins in the first round
-Most wins in the second round
-Most wins in the third round
-Longest current streak(which is found in details, but one of their matches has to be present in the current time frame)
Example: so for most wins, it will be the top 20 fighters with most wins. For most fights, it will be the top 20 fighters with most fights and so on.
All these stats will be based on the timeframe determined by the date (for example, the last 12 months). And to calculate that date you have to use all the fighter's matches inside that timeframe.
Example: For most fights in the last 12 months - you have to calculate how many fights a fighter has had in the last 12 months.
Then we have the sub-categories which are their weight class. If I, for example, use the file with all the Norwegian fighters the program has to produce the stats (top 20 per stat) as stated above for all the weight classes together (no filtering for weight class), but it also has to create them separately for all the weight classes (filtered by their weight classes).
The weight classes are:
-Flyweight
-Bantamweight
-Featherweight
-Lightweight
-Welterweight
-Middleweight
-Light heavyweight
-Heavyweight
Their weight class for each fighter can be found in the child weigh_class which is under the parent details. If the value of that key is also null you can use the last match of the fighter, because it also has the keyword weight_class. If the value of that key is also null, you skip that fighter when creating data for the separate weight classes, but include that fighter when the first category is created, which represents all weight classes as stated earlier.
Then there are the sub-files.
The sub-files will be based on:
-Gender
-if the matches the fighter has fought are either pro or amateur
So if I give the program a JSON file with all the Norwegian fighters, the program has to do all the things stated above and then create new files which will be first based on gender. Then the files that are based on gender will be divided again for pro or amateur.
The gender part is simple. For example, when using the JSON file with Norwegian fighters you will produce the top 20 fighters for each stat, then the top 20 fighters for each stat, but for each weight class. Then do the same thing but now it is the top 20 for females and top 20 for males and then the top 20 for the weight class of each gender.
The pro or amateur part is harder because the pro or amateur is not based on if they are pro at the current moment, but on their matches in the current time frame. For example: if a fighter has fought 11 fights in the last 12 months and 10 of his fights are amateur and 1 is pro, his stat in the first file is 11, but when divided by pro or amateur his fights in the last 12 months in the pro-file will then be 1 and in the amateur-file be 10.
You also don't have to make the changing of the time frame super easy, just changeable, since I program in Swift and I make some web-scraping scripts in Python myself.
Feel free to ask me questions. I will also leave files with the structure of the program and the JSON files you will be working with.