A package allowing you to parse skyblock profile information including networth.
Project description
skyblockparser v2.0
This requires a Hypixel API Key
Installation
Python 3.7 or higher is required.
Run pip install skyblockparser.
An Example bot can be found here:
Usage for Parsing Profiles
In the following example, we use the Profile class to get the stats of each member in a SkyBlock profile.
from skyblockparser.profile import SkyblockParser
import requests
api_key = ""
uuid = "28667672039044989b0019b14a2c34d6" # Refractions UUID
url = f"https://api.hypixel.net/v2/skyblock/profiles?key={api_key}&uuid={uuid}"
response = requests.get(url).json()
player = SkyblockParser(response, uuid, api_key)
print(player.get_profiles()) # ['Apple', 'Tomato', 'Pineapple', 'Zucchini', 'Coconut', 'Pomegranate']
profile = player.select_profile("selected") # Selected Profile of Refraction
await profile.init()
profile.get_items()
# This supports Profile Names too!
print(profile.skill_data)
print(profile.dungeon_data)
print(profile.slayer_data)
# Printing some example data.
profile.inv[0].render().show()
# Item Render
Usage for parsing the Auction House
As it is:
from skyblockparser.auctionhouse import AuctionHouseParser
import aiohttp
import asyncio
async def main():
async with aiohttp.ClientSession as session:
parser = AuctionHouseParser(session)
await parser.update_caches()
await session.close()
print(await parser.lowest_price("Hyperion"))
render = await parser.render_lowest_price("Hyperion")
render.show()
asyncio.run(main())
Usage in an API:
from skyblockparser.auctionhouse import AuctionHouseParser
import aiohttp
import io
from quart import Quart, jsonify, send_file
from discord.ext import tasks
"""
discord is used for loops, can be py-cord or discord.py
or you can use your own method of implementing loops!
"""
class App(Quart):
def __init__(self):
super().__init__(__name__)
@tasks.loop(count=1)
async def init(self):
self.session = aiohttp.ClientSession()
self.parser = AuctionHouseParser(self.session)
@tasks.loop(minutes=1)
async def update_caches(self):
await self.parser.update_caches()
app = App()
@app.before_serving
async def start_tasks():
app.init.start()
app.update_caches.start()
@app.route("/whole_cache")
async def whole_cache():
return jsonify(app.parser.auction_cache)
@app.route("/lowest_price/<item>")
async def lowest_price(item):
return jsonify(await app.parser.lowest_price(item))
@app.route("/render/lowestprice/<itemName>")
async def render_lowest_price(itemName):
lowest_price_render = await app.parser.render_lowest_price(itemName)
image_binary = io.BytesIO()
lowest_price_render.save(image_binary, format="PNG")
image_binary.seek(0)
return await send_file(image_binary, mimetype="image/png")
app.run("0.0.0.0", 3000)
Valid Storage Types:
Regular:
inv
ender_chest
inv_armor
wardrobe
equipment
personal_vault
backpack_[index starting at 0] (Storage) the index sets the backpack
pets
museum_data
Bags:
potion_bag
talisman_bag
fishing_bag
quiver
sacks
Valid Stat Types:
skill_data
dungeon_data
slayer_data
mining_data
Profile Data:
profile_type
profile_id
general_stats (includes most things that arent listed under the other 3)
bestiary
quests
nether
Networth:
networth_data
Note:
- Pets do not support rendering yet *unless they are not from the Pet Menu #HypixelAddPetLoreToApi
- If you want to use your own hosted api, or if mine ever goes offline, the code is in the
apidirectory - If the user is not in a profile with the given profile name, it will return the selected one.
This is in very early stages of development so do expect a few changes!
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
skyblockparser-2.0.tar.gz
(3.2 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skyblockparser-2.0.tar.gz.
File metadata
- Download URL: skyblockparser-2.0.tar.gz
- Upload date:
- Size: 3.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2169611987f46724d562849bd39c89959c59795288a51568e0806f37d93e27f4
|
|
| MD5 |
e62a2f20df8eec4796c3bb16bfe3e18a
|
|
| BLAKE2b-256 |
89ed2f62f54baeffcaa8a701cd5a0e1100980484b3a8ca9fe14b2271b612b77c
|
File details
Details for the file skyblockparser-2.0-py3-none-any.whl.
File metadata
- Download URL: skyblockparser-2.0-py3-none-any.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a39c4603faa67b7877a8f0f7f62e4ff2894ae8ac9e8ec158b65941876b8595f6
|
|
| MD5 |
745deacfb783c20c60b9bc70a075e1d4
|
|
| BLAKE2b-256 |
f6ec7acc2839405aed205855ba1562a400e4577c2e40746e6dcf47b08e5ea4ae
|