Package: minecraftstats
minecraftstatsMinecraftstats is an API wrapper for the Minecraft server Hypixel. The library only currently allows the user to get
duel and bedwars stats.installationusingpippip install minecraftstatsusing setup.py to installgit clone https://github.com/justbennnn/minecraftstats.git
cd minecraftstats
python setup.py installusageImportant: An API key can be obtained by logging onto the Hypixel server, and typing/api new.Note: The main framework for this project isPydantic.Side Note: Any stats that return hearts are measured in halves.generalThis example shows how to access general data from the Hypixel lobby.importminecraftstatsasmsms.set_username("username")#the username for the account that you want to get the stats fromms.set_api_key("your_api_key")stats=ms.get_user_stats()print(list(stats.general.__fields__.keys()))#show all available attributes for general statsfirst_login=stats.general.first_login#returns a datetime objectprint("First login (day/month/year):",str(first_login.day)+"/"+str(first_login.month)+"/"+str(first_login.year))print("Achievements:",stats.general.achievement_points)print("Hypixel level:",stats.general.level)The next set of examples will show how to get stats from different game modes.duelsimportminecraftstatsasmsms.set_username("username")#the username for the account that you want to get the stats fromms.set_api_key("your_api_key")stats=ms.get_user_stats()print(list(stats.overall_duels.__fields__.keys()))#show all available functions for overall_duelsprint("Total wins:",stats.overall_duels.wins)print("Total kills:",stats.overall_duels.kills)print("Most recent game mode played:",stats.overall_duels.recent_games[0])The best way to retrieve stats is by creating a variable which usesms.get_user_stats()to get the Hypixel
user's data, and then accessing different stats as attributes to the variable.The next examples show how those attributes can be accessed.print(list(stats.uhc_duels.__fields__.keys()))#show all available stats for uhc_duelsprint("UHC wins:",stats.uhc_duels.wins)print("Best UHC winstreak:",stats.uhc_duels.best_winstreak)print("UHC golden apples eaten",stats.uhc_duels.golden_apples_eaten)bedwarsprint(list(stats.overall_bedwars.__fields__.keys()))#show all available functions for overall_bedwarsprint("Total wins:",stats.overall_bedwars.wins)print("Total kills:",stats.overall_bedwars.kills)print("Total beds broken:",stats.overall_bedwars.beds_broken)As shown above, all of the key concepts are the same as the duels stats example.bedwars practice modeprint(list(stats.practice_bedwars.__fields__.keys()))#show all available functions for practice_bedwarsprint("Bridging record:",stats.practice_bedwars.records.bridging_record)print("Bridging blocks placed:",stats.practice_bedwars.bridging.blocks_placed)print("Successful MLG attempts:",stats.practice_bedwars.mlg.successful_attempts)skywarsprint(list(stats.overall_skywars.__fields__.keys()))print("Wins:",stats.overall_skywars.wins)print("Games played:",stats.overall_skywars.games_played)print("Coins:",stats.overall_skywars.coins)CHANGELOG1.1.6Capture The Flag Trios Duels stats added.1.1.5Skywars stats updates:Created a Solo Skywars stats class.Added a Skywars level stat.Added more stats to the General stats file.Created more efficient models.Added the following Bedwars stats classes:SoloDuosTriosSquadsFour Versus FourAdded the following Duels stats classes:OP DoublesUHC Meetup(Deathmatch)1.1.4The API link now uses the user's uuid instead of player name.Created a General Hypixel stats file.Removed unnecessary imports from__init__.py.Updated annotations on several files.Addedmojanglibrary torequirements.txt.1.1.3Fixed Practice stats bug.1.1.2Added UHC and Bridge double stats.1.1.1Added Bedwars cosmetic stats.1.1.0Added Bedwars practice stats.Small changes toutils.py.1.0.9AddedStatsModelclass toutils.py.1.0.8The user no longer has to create an instance of the class model.Fixed bridge_duel suffix typo.1.0.7Fixed kwarg filter error.1.0.6Created stats model and kwarg filter(for prefixes/suffixes).Created requirements.txt.1.0.5Created CHANGELOG.Added SkyWars duel stats.1.0.4Changed mainframe toPydantic.Removed theavailable_functionsvariables.