From a302f124eb2de5249ecf840f802a42ed1ac80b6b Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Sun, 7 Apr 2024 09:41:01 +0530 Subject: [PATCH 1/4] Add some example code to README --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 29e068c..59593aa 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,21 @@ Go to the Hypixel Minecraft Java server and use `/api` command. ### I found a bug/I want to add a missing feature! Just make a new issue [here](https://github.com/PyBotDevs/skyblockpy/issues/new) and describe the bug/feature. +### Example Implementation of SkyblockPy +Here's an example snippet of retrieving the third page of the latest Skyblock auctions. + +```py +import skyblockpy + +skyblock = skyblockpy.Skyblock("api_key") # Initialize the Skyblock class with a prospective Hypixel API key. + +def latest_auctions_raw() -> dict: # Make a function for returning API output, and highlight return output type as dict. + output = skyblock.get_auctions(page=3) # Gets the API response. + return output + +latest_auctions_raw() # Run the actual function now. +``` +
### Hypixel API Documentation is given here: https://api.hypixel.net/ From 2dffb0858fdca238b0ff8f2ea2790a9f076ccb2a Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Sun, 7 Apr 2024 09:43:00 +0530 Subject: [PATCH 2/4] Add some headers to README --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 59593aa..b7d3c76 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![CodeFactor](https://www.codefactor.io/repository/github/pybotdevs/skyblockpy/badge)](https://www.codefactor.io/repository/github/pybotdevs/skyblockpy) +## About ### What is SkyblockPy? SkyblockPy is a simple Python API wrapper which is used to communicate and fetch data from the Hypixel Skyblock API endpoints. It is based on the Python requests library, which makes it very simple to develop for and fix issues. @@ -12,12 +13,10 @@ SkyblockPy works by communicating with the Hypixel API endpoints by using your * If no errors are returned by the API endpoint (status code 200 is returned), then the API output is returned as a `dict`. +## Setup and Usage ### Obtaining an API key Go to the Hypixel Minecraft Java server and use `/api` command. -### I found a bug/I want to add a missing feature! -Just make a new issue [here](https://github.com/PyBotDevs/skyblockpy/issues/new) and describe the bug/feature. - ### Example Implementation of SkyblockPy Here's an example snippet of retrieving the third page of the latest Skyblock auctions. @@ -33,6 +32,10 @@ def latest_auctions_raw() -> dict: # Make a function for returning API output, latest_auctions_raw() # Run the actual function now. ``` +## Extra +### I found a bug/I want to add a missing feature! +Just make a new issue [here](https://github.com/PyBotDevs/skyblockpy/issues/new) and describe the bug/feature. +
### Hypixel API Documentation is given here: https://api.hypixel.net/ From 6ab45cd5c357bc7a3205a73762a6f911491fea8b Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Sun, 7 Apr 2024 09:50:49 +0530 Subject: [PATCH 3/4] Add another example code snippet in README --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index b7d3c76..7241ade 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,20 @@ def latest_auctions_raw() -> dict: # Make a function for returning API output, latest_auctions_raw() # Run the actual function now. ``` +Here's another example snippet on getting information on a player in Hypixel. + +```py +import skyblockpy + +skyblock = skyblockpy.Skyblock("api_key") # Initialize the Skyblock class with a prospective Hypixel API key. + +def get_player_info() -> dict: # Make a function for returning API output, and highlight return output type as dict. + output = skyblock.get_player_info("notsniped") # Gets an API response on player info for a user "notsniped". + return output + +get_player_info() # Run the actual function. +``` + ## Extra ### I found a bug/I want to add a missing feature! Just make a new issue [here](https://github.com/PyBotDevs/skyblockpy/issues/new) and describe the bug/feature. From bd4e874e968d28c338a5e5fb8c61beab50f13317 Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Sun, 7 Apr 2024 09:52:05 +0530 Subject: [PATCH 4/4] Improve a code snippet comment to make more sense --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7241ade..e9f5a3b 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ import skyblockpy skyblock = skyblockpy.Skyblock("api_key") # Initialize the Skyblock class with a prospective Hypixel API key. def latest_auctions_raw() -> dict: # Make a function for returning API output, and highlight return output type as dict. - output = skyblock.get_auctions(page=3) # Gets the API response. + output = skyblock.get_auctions(page=3) # Gets the API response, and returns the third page of contents. return output latest_auctions_raw() # Run the actual function now.