A wrapper for the Wynncraft API.
Project description
wynncraft-python
A wrapper for the Wynncraft API, with local caching.
Install
Requires at least python 3.6
pip install wynncraft
Information
-
All information returned in JSON format.
-
How does caching works?
The default funcions don't use cache at all (wynncraft.Guild.list()
).
You need to use the cache variants (wynncraft.cache.Guild.list()
). All functions available with this functionality.
It will make a request if:- response hasn't been cached
- data in the cache is older than CACHE_TIME
-
Constants
This wrapper has some variables that you could modify.API_KEY
: Your API key. Not required.CACHE_TIME
: If the data in cache is older than CACHE_TIME seconds, then a new request will be made.TIMEOUT
: Specifies a timeout in seconds for http request.
Variable(s) for the rate limiter:
RL_ENABLE
: Enables the rate limiter.
For example:
import wynncraft # Enables the rate limiter wynncraft.RL_ENABLE = True # If you can any function too many times, it will delay it. # And you will not exceed your rate limit.
Functions
Guild
wynncraft.Guild.list()
wynncraft.Guild.stats("Wynncraft")
Ingredient
wynncraft.Ingredient.get("apple")
wynncraft.Ingredient.list()
# Valid queries: name, tier, level, skills, sprite, identifications, itemOnlyIDs, consumableOnlyIDs
wynncraft.Ingredient.search(query, arg)
# Same as Ingredient.search("name", arg)
wynncraft.Ingredient.search_name(arg)
# Same as Ingredient.search("tier", arg)
wynncraft.Ingredient.search_tier(arg)
# Same as Ingredient.search("level", arg)
wynncraft.Ingredient.search_level(arg)
# Same as Ingredient.search("skills", arg)
wynncraft.Ingredient.search_skills(arg)
# Same as Ingredient.search("sprite", arg)
wynncraft.Ingredient.search_sprite(arg)
# Same as Ingredient.search("identifications", arg)
wynncraft.Ingredient.search_identifications(arg)
# Same as Ingredient.search("itemOnlyIDs", arg)
wynncraft.Ingredient.search_item_only_ids(arg)
# Same as Ingredient.search("consumableOnlyIDs", arg)
wynncraft.Ingredient.search_consumable_only_ids(arg)
Item
# Valid categories: all, boots, bow, bracelet, chestplate, dagger, helmet, leggings, necklace, ring, spear, wand
wynncraft.Item.database_category(all)
wynncraft.Item.database_search("Idol")
Leaderboard
wynncraft.Leaderboard.guild(timeframe)
wynncraft.Leaderboard.player(timeframe)
wynncraft.Leaderboard.pvp(timeframe)
Network
wynncraft.Network.server_list()
wynncraft.Network.player_sum()
Player
wynncraft.Player.stats("Salted")
wynncraft.Player.uuid("Salted")
Recipe
wynncraft.Recipe.get("Boots-1-3")
wynncraft.Recipe.list()
# Valid queries: type, skill, level, durability, healthOrDamage, duration, basicDuration
wynncraft.Recipe.search(query, arg)
# Same as Recipe.search("type", arg)
wynncraft.Recipe.search_type(arg)
# Same as Recipe.search("skill", arg)
wynncraft.Recipe.search_skill(arg)
# Same as Recipe.search("level", arg)
wynncraft.Recipe.search_level(arg)
# Same as Recipe.search("durability", arg)
wynncraft.Recipe.search_durability(arg)
# Same as Recipe.search("healthOrDamage", arg)
wynncraft.Recipe.search_health_or_damage(arg)
# Same as Recipe.search("duration", arg)
wynncraft.Recipe.search_duration(arg)
# Same as Recipe.search("basicDuration", arg)
wynncraft.Recipe.search_basic_duration(arg)
Search
wynncraft.Search.name("Salted")
Territory
wynncraft.Territory.list()
For more documentation see the Wynncraft API documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wynncraft-1.0.1.tar.gz
(9.3 kB
view hashes)
Built Distribution
Close
Hashes for wynncraft-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5c8aa68ae9816d362e4b2f9d1f9f7f6133b7452535fba4434ff2b594fa7c8e6 |
|
MD5 | 523400df266653797964f42af9068c0c |
|
BLAKE2b-256 | 889dec1c5f4dbbf73d4b8089b73618dc28636a04aac4d48209a3271d1da47cd0 |