# skyblockparser v1.2
## This requires a [Hypixel API Key](https://developer.hypixel.net)
## Installation
Python 3.7 or higher is required.
Run `pip install skyblockparser`.
## An Example bot can be found here:
[Example Bot](https://github.com/noemtdev/skyblockparser-example)
## Usage for Parsing Profiles
In the following example, we use the Profile class to get the stats of each member in a SkyBlock profile.
```py
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:
```py
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:
```py
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 `api` directory
- 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!
Raw data
{
"_id": null,
"home_page": "",
"name": "skyblockparser",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "python,hypixel,skyblock,hypixel skyblock",
"author": "nom",
"author_email": "nom <noemtdev@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/b9/a1/105a5f8280f96ad22f1c4f25a5fd3a326195b49909a691f9c6f3be6d5659/skyblockparser-1.2.tar.gz",
"platform": null,
"description": "# skyblockparser v1.2\r\n## This requires a [Hypixel API Key](https://developer.hypixel.net)\r\n\r\n## Installation\r\nPython 3.7 or higher is required.\r\n\r\nRun `pip install skyblockparser`.\r\n\r\n## An Example bot can be found here:\r\n[Example Bot](https://github.com/noemtdev/skyblockparser-example)\r\n\r\n## Usage for Parsing Profiles\r\nIn the following example, we use the Profile class to get the stats of each member in a SkyBlock profile.\r\n\r\n```py\r\nfrom skyblockparser.profile import SkyblockParser\r\nimport requests\r\n\r\napi_key = \"\"\r\nuuid = \"28667672039044989b0019b14a2c34d6\" # Refractions UUID\r\n\r\nurl = f\"https://api.hypixel.net/v2/skyblock/profiles?key={api_key}&uuid={uuid}\"\r\n\r\nresponse = requests.get(url).json()\r\n\r\nplayer = SkyblockParser(response, uuid, api_key)\r\nprint(player.get_profiles()) # ['Apple', 'Tomato', 'Pineapple', 'Zucchini', 'Coconut', 'Pomegranate']\r\nprofile = player.select_profile(\"selected\") # Selected Profile of Refraction\r\nawait profile.init()\r\nprofile.get_items()\r\n# This supports Profile Names too!\r\n\r\nprint(profile.skill_data)\r\nprint(profile.dungeon_data)\r\nprint(profile.slayer_data)\r\n# Printing some example data.\r\n\r\nprofile.inv[0].render().show()\r\n# Item Render\r\n```\r\n## Usage for parsing the Auction House\r\n### As it is:\r\n```py\r\nfrom skyblockparser.auctionhouse import AuctionHouseParser\r\nimport aiohttp\r\nimport asyncio\t\r\n\r\nasync def main():\r\n async with aiohttp.ClientSession as session:\r\n parser = AuctionHouseParser(session)\r\n await parser.update_caches()\r\n await session.close()\r\n print(await parser.lowest_price(\"Hyperion\"))\r\n render = await parser.render_lowest_price(\"Hyperion\")\r\n render.show()\r\n\r\nasyncio.run(main())\r\n```\r\n\r\n### Usage in an API:\r\n```py\r\nfrom skyblockparser.auctionhouse import AuctionHouseParser\r\nimport aiohttp\r\nimport io\r\n\r\nfrom quart import Quart, jsonify, send_file\r\nfrom discord.ext import tasks\r\n\"\"\"\r\ndiscord is used for loops, can be py-cord or discord.py\r\nor you can use your own method of implementing loops!\r\n\"\"\"\r\n\r\nclass App(Quart):\r\n def __init__(self):\r\n super().__init__(__name__)\r\n\r\n @tasks.loop(count=1)\r\n async def init(self):\r\n self.session = aiohttp.ClientSession()\r\n self.parser = AuctionHouseParser(self.session)\r\n\r\n @tasks.loop(minutes=1)\r\n async def update_caches(self):\r\n await self.parser.update_caches()\r\n\r\n\r\napp = App()\r\n\r\n@app.before_serving\r\nasync def start_tasks():\r\n app.init.start()\r\n app.update_caches.start()\r\n\r\n@app.route(\"/whole_cache\")\r\nasync def whole_cache():\r\n return jsonify(app.parser.auction_cache)\r\n\r\n@app.route(\"/lowest_price/<item>\")\r\nasync def lowest_price(item):\r\n return jsonify(await app.parser.lowest_price(item))\r\n\r\n@app.route(\"/render/lowestprice/<itemName>\")\r\nasync def render_lowest_price(itemName):\r\n\r\n lowest_price_render = await app.parser.render_lowest_price(itemName)\r\n image_binary = io.BytesIO()\r\n lowest_price_render.save(image_binary, format=\"PNG\")\r\n image_binary.seek(0)\r\n return await send_file(image_binary, mimetype=\"image/png\")\r\n\r\napp.run(\"0.0.0.0\", 3000)\r\n\r\n```\r\n\r\n## Valid Storage Types:\r\n### Regular:\r\n```\r\ninv \r\nender_chest\r\ninv_armor\r\nwardrobe\r\nequipment\r\npersonal_vault\r\nbackpack_[index starting at 0] (Storage) the index sets the backpack\r\npets\r\nmuseum_data\r\n```\r\n\r\n### Bags:\r\n```\r\npotion_bag\r\ntalisman_bag\r\nfishing_bag\r\nquiver\r\nsacks\r\n```\r\n\r\n## Valid Stat Types:\r\n```\r\nskill_data\r\ndungeon_data\r\nslayer_data\r\nmining_data\r\n```\r\n\r\n## Profile Data:\r\n```\r\nprofile_type\r\nprofile_id\r\ngeneral_stats (includes most things that arent listed under the other 3)\r\nbestiary\r\nquests\r\nnether\r\n```\r\n\r\n## Networth:\r\n```\r\nnetworth_data\r\n```\r\n\r\n# Note:\r\n- Pets do not support rendering *yet* *unless they are not from the Pet Menu #HypixelAddPetLoreToApi\r\n- If you want to use your own hosted api, or if mine ever goes offline, the code is in the `api` directory\r\n- If the user is not in a profile with the given profile name, it will return the selected one.\r\n### This is in very early stages of development so do expect a few changes!\r\n",
"bugtrack_url": null,
"license": "",
"summary": "A package allowing you to parse skyblock profile information including networth.",
"version": "1.2",
"project_urls": {
"Bug Tracker": "https://github.com/noemtdev/skyblockparser/issues",
"Homepage": "https://github.com/noemtdev/skyblockparser"
},
"split_keywords": [
"python",
"hypixel",
"skyblock",
"hypixel skyblock"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b6d31fb7c3e2f9fea3d55aa9cdfb830a549b3314aa059d94cead00de6076acf4",
"md5": "f8920059c2ee881ea4dfdc14bf096ee4",
"sha256": "321ac1b56584bfb8eacbe0699b6a32e117a433446fa16a7720804fc123413e00"
},
"downloads": -1,
"filename": "skyblockparser-1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f8920059c2ee881ea4dfdc14bf096ee4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 3302691,
"upload_time": "2024-03-08T12:23:48",
"upload_time_iso_8601": "2024-03-08T12:23:48.101129Z",
"url": "https://files.pythonhosted.org/packages/b6/d3/1fb7c3e2f9fea3d55aa9cdfb830a549b3314aa059d94cead00de6076acf4/skyblockparser-1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b9a1105a5f8280f96ad22f1c4f25a5fd3a326195b49909a691f9c6f3be6d5659",
"md5": "e55f4492d20006d7c9768f9b3a9e1406",
"sha256": "97f83b993a8cc9050061ac8bae88d3ec5d4eebcb2b4e5b41640efe99c4d0a487"
},
"downloads": -1,
"filename": "skyblockparser-1.2.tar.gz",
"has_sig": false,
"md5_digest": "e55f4492d20006d7c9768f9b3a9e1406",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 3166399,
"upload_time": "2024-03-08T12:23:55",
"upload_time_iso_8601": "2024-03-08T12:23:55.076132Z",
"url": "https://files.pythonhosted.org/packages/b9/a1/105a5f8280f96ad22f1c4f25a5fd3a326195b49909a691f9c6f3be6d5659/skyblockparser-1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-08 12:23:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "noemtdev",
"github_project": "skyblockparser",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "pillow",
"specs": [
[
"==",
"9.5.0"
]
]
},
{
"name": "aiohttp",
"specs": []
}
],
"lcname": "skyblockparser"
}