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 dict
s to objects.
Player¶
-
wynn.player.
getPlayer
(name)¶ Gets a
Player
object 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 Return 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.
getGuilds
()¶ Gets a list of guild names from the Wynncraft API.
Returns: A list
ofstr
containing the names of all Wynncraft guilds.Return type: list
-
wynn.guild.
getGuild
(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 Return 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.
getIngredientNames
()¶ Gets a
list
ofstr
objects containing all ingredient names from the Wynncraft API.Returns: A list of all ingredient names as str
Return type: list
-
wynn.ingredient.
getIngredient
(name)¶ Gets an Ingredient as an
ObjectFromDict
object 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 Return type: ObjectFromDict
-
wynn.ingredient.
searchIngredients
(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
Return type:
Recipe¶
-
wynn.recipe.
getRecipeIDs
()¶ Gets a
list
ofstr
objects containing all recipe IDs from the Wynncraft API.Returns: A list of all recipeIDs as str
Return type: list
-
wynn.recipe.
getRecipe
(id)¶ Gets a Recipe as an
ObjectFromDict
object 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.
searchRecipes
(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
Return type:
Network¶
-
wynn.network.
getServers
()¶ Gets the currently active servers and the players on them.
Format: https://docs.wynncraft.com/Network-API/#server-list
Returns: A dict
oflist
s by server name containing the names of the players connected to that serverReturn type: dict
Leaderboard¶
-
wynn.leaderboard.
getGuildLeaderboard
(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 list
of guild leaderboard objects (Format: https://docs.wynncraft.com/Leaderboard-API/#guild-leaderboard-object) asObjectFromDict
Return type: list
-
wynn.leaderboard.
getPlayerLeaderboard
(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 list
of player leaderboard objects (Format: https://docs.wynncraft.com/Leaderboard-API/#player-leaderboard-object) asObjectFromDict
Return type: list
-
wynn.leaderboard.
getPVPLeaderboard
(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 list
of player leaderboard objects (Format: https://docs.wynncraft.com/Leaderboard-API/#player-leaderboard-object) asObjectFromDict
Return type: list
Territory¶
-
wynn.territory.
getTerritories
()¶ Gets a list of all territories.
Territory format: https://docs.wynncraft.com/Territory-API/#territory-object
Returns: A list of ObjectFromDict
representing 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 guilds
containing guild name results andplayers
containing player name resultsReturn type: ObjectFromDict
Item¶
-
wynn.item.
searchItem
(*, 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
ObjectFromDict
Return type: