aiohypixel.player

Documentation

Custom classes that are related to player lookups on the Hypixel API

aiohypixel.player.BASE = 10000
aiohypixel.player.BEDWARS_EXP_PER_PRESTIGE = 489000
aiohypixel.player.BEDWARS_LEVELS_PER_PRESTIGE = 100
aiohypixel.player.BW_LVLS_PER_PRESTIGE = 100
aiohypixel.player.BW_XP_PER_PRESTIGE = 489000
aiohypixel.player.EXP_FIELD = 0

Level calculation stuff

aiohypixel.player.GROWTH = 2500
aiohypixel.player.GROWTH_DIVIDES_2 = 0.0008
aiohypixel.player.HALF_GROWTH = 1250.0
aiohypixel.player.LVL_FIELD = 0
aiohypixel.player.POSSIBLE_RANK_LOC = ('packageRank', 'newPackageRank', 'monthlyPackageRank', 'rank')

Locations where the player rank might be stored

class aiohypixel.player.Player(raw_data, hypixel_id, uuid, username, aliases, one_time_achievements, achievments, mc_version, rank, was_staff, rank_colour, rank_color, outfit, voting, parkours, stats=None)

This will describe a player

classmethod from_api_response(resp)

Processes the raw API response into a Player object.

Parameters

resp (NewType()(APIResponse, Dict[str, Any])) – The API response to process.

Returns

The processed Player object.

stats = None

If it is None, it means the full player info wasn’t requested

class aiohypixel.player.PlayerInfo
classmethod from_api_response(resp)

Processes the raw API response into a PlayerStats object.

Parameters

resp (NewType()(APIResponse, Dict[str, Any])) – The API response to process.

Returns

The processed PlayerStats object.

class aiohypixel.player.PlayerStats
classmethod from_api_response(resp)

Processes the raw API response into a PlayerStats object.

Parameters

resp (NewType()(APIResponse, Dict[str, Any])) – The API response to process.

Returns

The processed PlayerStats object.

aiohypixel.player.REVERSE_CONST = 12.25
aiohypixel.player.REVERSE_PQ_PREFIX = -3.5
aiohypixel.player.get_bw_lvl(exp)
Return type

int

aiohypixel.player.get_exact_level(exp)
aiohypixel.player.get_exp(EXP_FIELD, LVL_FIELD)
aiohypixel.player.get_exp_from_lvl_to_next(level)
aiohypixel.player.get_level(exp)
aiohypixel.player.get_percentage_to_next_lvl(exp)
aiohypixel.player.get_total_exp_to_full_lvl(level)
aiohypixel.player.get_total_exp_to_lvl(level)
aiohypixel.player.process_raw_player(json_data, partial=False)

This handles the raw json returned by the API and creates a Player object Pass the partial param as True to get a PartialPlayer object instead.

Return type

Player

aiohypixel.player.process_raw_player_stats(json_data, game=None)

This will process the JSON data into a tuple of game stats

Return type

Tuple[ImmutableProxy]

Inheritance Diagram

Inheritance diagram of aiohypixel.player