API Reference¶
Requests¶
The wynn.requests module contains internal utilities used by wynn.py.
Most importantly it contains the ObjectFromDict class which is
used to convert dicts to objects.
Player¶
-
wynn.player.get_player(name)¶ Gets a
Playerobject from the Wynncraft API.Format: https://docs.wynncraft.com/Player-API/#player-object
Parameters: name ( str) – The name of the PlayerReturns: The Player returned by the API or Noneif not foundReturn type: Player
-
class
wynn.player.Player(data)¶ Contains Player data in the Wynncraft API format.
Format: https://docs.wynncraft.com/Player-API/#player-object
Parameters: data (
dict) – The parsed JSON data from the Wynncraft APIVariables:
Guild¶
-
wynn.guild.get_guilds()¶ Gets a list of guild names from the Wynncraft API.
Returns: A listofstrcontaining the names of all Wynncraft guilds.Return type: list
-
wynn.guild.get_guild(name)¶ Gets a guild’s information from the Wynncraft API.
Format: https://docs.wynncraft.com/Guild-API/#guild-object
Parameters: name ( str) –Returns: The information of the guild as returned by the API or Noneif not foundReturn type: Guild
-
class
wynn.guild.Guild(data)¶ Contains Guild data in the Wynncraft API format.
Format: https://docs.wynncraft.com/Guild-API/#guild-object
Parameters: data ( dict) – The parsed JSON data from the Wynncraft APIVariables: owner ( ObjectFromDict) – The owner member of this guild
Ingredient¶
-
wynn.ingredient.get_ingredient_names()¶ Gets a
listofstrobjects containing all ingredient names from the Wynncraft API.Returns: A list of all ingredient names as strReturn type: list
-
wynn.ingredient.get_ingredient(name)¶ Gets an Ingredient as an
ObjectFromDictobject from the Wynncraft API.Format: https://docs.wynncraft.com/Ingredient-API/#ingredient-object
Parameters: name ( str) – The name of the IngredientReturns: The Ingredient returned by the API or Noneif not foundReturn type: ObjectFromDict
-
wynn.ingredient.search_ingredients(query, args)¶ Searches for ingredients from the Wynncraft API. See https://docs.wynncraft.com/Ingredient-API/#search for query format.
Parameters: Returns: A list of ingredients as
ObjectFromDict. Empty if the query fails.Return type:
Recipe¶
-
wynn.recipe.get_recipe_ids()¶ Gets a
listofstrobjects containing all recipe IDs from the Wynncraft API.Returns: A list of all recipeIDs as strReturn type: list
-
wynn.recipe.get_recipe(id)¶ Gets a Recipe as an
ObjectFromDictobject from the Wynncraft API.Format: https://docs.wynncraft.com/Recipe-API/#recipe-object
Parameters: name ( str) – The ID of the RecipeReturns: The Recipe returned by the API Return type: ObjectFromDict
-
wynn.recipe.search_recipes(query, args)¶ Searches for recipes from the Wynncraft API. See https://docs.wynncraft.com/Recipe-API/#search for query format.
Parameters: Returns: A list of recipes as
ObjectFromDict. Empty if the query failed.Return type:
Network¶
-
wynn.network.get_servers()¶ Gets the currently active servers and the players on them.
Format: https://docs.wynncraft.com/Network-API/#server-list
Returns: A dictoflists by server name containing the names of the players connected to that serverReturn type: dict
Leaderboard¶
-
wynn.leaderboard.get_guild_leaderboard(timeframe=None)¶ Gets a guild leaderboard from Wynncraft.
Parameters: timeframe – A time frame to get the leaderboard from. If
None,'alltime'will be used.Note
The format is not disclosed in the Wynncraft API documentation
Returns: A listof guild leaderboard objects (Format: https://docs.wynncraft.com/Leaderboard-API/#guild-leaderboard-object) asObjectFromDictReturn type: list
-
wynn.leaderboard.get_player_leaderboard(timeframe=None)¶ Gets a player leaderboard from Wynncraft.
Parameters: timeframe – A time frame to get the leaderboard from. If
None,'alltime'will be used.Note
The format is not disclosed in the Wynncraft API documentation
Returns: A listof player leaderboard objects (Format: https://docs.wynncraft.com/Leaderboard-API/#player-leaderboard-object) asObjectFromDictReturn type: list
-
wynn.leaderboard.get_pvp_leaderboard(timeframe=None)¶ Gets a player leaderboard from Wynncraft sorted by PvP kills.
Parameters: timeframe – A time frame to get the leaderboard from. If
None,'alltime'will be used.Note
The format is not disclosed in the Wynncraft API documentation
Returns: A listof player leaderboard objects (Format: https://docs.wynncraft.com/Leaderboard-API/#player-leaderboard-object) asObjectFromDictReturn type: list
Territory¶
-
wynn.territory.get_territories()¶ Gets a list of all territories.
Territory format: https://docs.wynncraft.com/Territory-API/#territory-object
Returns: A list of ObjectFromDictrepresenting every territoryReturn type: list
Search¶
-
wynn.search.search(name)¶ Searches for guild and player names containing the search string.
Parameters: name ( str) – The name to searchReturns: An object with attribute guildscontaining guild name results andplayerscontaining player name results. The lists are empty if the query failed.Return type: ObjectFromDict
Item¶
-
wynn.item.search_item(*, name=None, category=None)¶ Searches for items. If a name is provided, will return a list of all items whose names contain the provided name (case insensitive). Otherwise, if a category is provided, will return a list of items of that type.
Note
This means that if both are provided, this function will only return items by name.
Parameters: Returns: A list of items as
ObjectFromDictReturn type: