From d3a26394cb3bad0bd79c57afa8c7a6d16d9525d2 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 12:25:16 +0530 Subject: [PATCH 01/55] Work on refactoring the codebase. --- Pipfile.lock | 88 +++++++++++++---------- hypixelio/__init__.py | 2 +- hypixelio/exceptions/exceptions.py | 36 ++++------ hypixelio/models/boosters/booster_info.py | 4 +- hypixelio/models/boosters/boosters.py | 4 +- hypixelio/models/caching/backend.py | 4 +- hypixelio/models/caching/caching.py | 28 ++++---- hypixelio/models/friends/friends.py | 4 +- hypixelio/utils/constants.py | 1 - hypixelio/utils/helpers.py | 9 +-- 10 files changed, 83 insertions(+), 97 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 31b8c86..083d566 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -58,11 +58,11 @@ }, "urllib3": { "hashes": [ - "sha256:19188f96923873c92ccb987120ec4acaa12f0461fa9ce5d3d0772bc965a39e08", - "sha256:d8ff90d979214d7b4f8ce956e80f4028fc6860e4431f731ea4a8c08f23f99473" + "sha256:1b465e494e3e0d8939b50680403e3aedaa2bc434b7d5af64dfd3c958d7f5ae80", + "sha256:de3eedaad74a2683334e282005cd8d7f22f4d55fa690a2a1020a416cb0a47e73" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.26.2" + "version": "==1.26.3" } }, "develop": { @@ -83,10 +83,11 @@ }, "autopep8": { "hashes": [ - "sha256:d21d3901cb0da6ebd1e83fc9b0dfbde8b46afc2ede4fe32fbda0c7c6118ca094" + "sha256:9e136c472c475f4ee4978b51a88a494bfcd4e3ed17950a44a988d9e434837bea", + "sha256:cae4bc0fb616408191af41d062d7ec7ef8679c7f27b068875ca3a9e2878d5443" ], "index": "pypi", - "version": "==1.5.4" + "version": "==1.5.5" }, "bandit": { "hashes": [ @@ -160,19 +161,19 @@ }, "gitpython": { "hashes": [ - "sha256:6eea89b655917b500437e9668e4a12eabdcf00229a0df1762aabd692ef9b746b", - "sha256:befa4d101f91bad1b632df4308ec64555db684c360bd7d2130b4807d49ce86b8" + "sha256:3283ae2fba31c913d857e12e5ba5f9a7772bbc064ae2bb09efafa71b0dd4939b", + "sha256:be27633e7509e58391f10207cd32b2a6cf5b908f92d9cd30da2e514e1137af61" ], "markers": "python_version >= '3.4'", - "version": "==3.1.11" + "version": "==3.1.14" }, "identify": { "hashes": [ - "sha256:943cd299ac7f5715fcb3f684e2fc1594c1e0f22a90d15398e5888143bd4144b5", - "sha256:cc86e6a9a390879dcc2976cef169dd9cc48843ed70b7380f321d1b118163c60e" + "sha256:2179e7359471ab55729f201b3fdf7dc2778e221f868410fedcb0987b791ba552", + "sha256:2a5fdf2f5319cc357eda2550bea713a404392495961022cf2462624ce62f0f46" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.5.10" + "markers": "python_full_version >= '3.6.1'", + "version": "==2.1.0" }, "iniconfig": { "hashes": [ @@ -197,11 +198,11 @@ }, "packaging": { "hashes": [ - "sha256:24e0da08660a87484d1602c30bb4902d74816b6985b93de36926f5bc95741858", - "sha256:78598185a7008a470d64526a8059de9aaa449238f280fc9eb6b13ba6c4109093" + "sha256:5b327ac1320dc863dca72f4514ecc086f31186744b84a230374cc1fd776feae5", + "sha256:67714da7f7bc052e064859c05c595155bd1ee9f69f76557e21f051443c20947a" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==20.8" + "version": "==20.9" }, "pbr": { "hashes": [ @@ -267,11 +268,11 @@ }, "pytest": { "hashes": [ - "sha256:1969f797a1a0dbd8ccf0fecc80262312729afea9c17f1d70ebf85c5e76c6f7c8", - "sha256:66e419b1899bc27346cb2c993e12c5e5e8daba9073c1fbce33b9807abc95c306" + "sha256:9d1edf9e7d0b84d72ea3dbcdfd22b35fb543a5e8f2a60092dd578936bf63d7f9", + "sha256:b574b57423e818210672e07ca1fa90aaf194a4f63f3ab909a2c67ebb22913839" ], "markers": "python_version >= '3.6'", - "version": "==6.2.1" + "version": "==6.2.2" }, "pytest-benchmark": { "hashes": [ @@ -283,21 +284,30 @@ }, "pyyaml": { "hashes": [ - "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97", - "sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76", - "sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2", - "sha256:6034f55dab5fea9e53f436aa68fa3ace2634918e8b5994d82f3621c04ff5ed2e", - "sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648", - "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf", - "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f", - "sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2", - "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee", - "sha256:ad9c67312c84def58f3c04504727ca879cb0013b2517c85a9a253f0cb6380c0a", - "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d", - "sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c", - "sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a" - ], - "version": "==5.3.1" + "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf", + "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696", + "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393", + "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77", + "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922", + "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5", + "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8", + "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10", + "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc", + "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018", + "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e", + "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253", + "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183", + "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb", + "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185", + "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db", + "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46", + "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b", + "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63", + "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df", + "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", + "version": "==5.4.1" }, "six": { "hashes": [ @@ -309,11 +319,11 @@ }, "smmap": { "hashes": [ - "sha256:54c44c197c819d5ef1991799a7e30b662d1e520f2ac75c9efbeb54a742214cf4", - "sha256:9c98bbd1f9786d22f14b3d4126894d56befb835ec90cef151af566c7e19b5d24" + "sha256:7bfcf367828031dc893530a29cb35eb8c8f2d7c8f2d0989354d75d24c8573714", + "sha256:84c2751ef3072d4f6b2785ec7ee40244c6f45eb934d9e543e2c51f1bd3d54c50" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==3.0.4" + "version": "==3.0.5" }, "stevedore": { "hashes": [ @@ -333,11 +343,11 @@ }, "virtualenv": { "hashes": [ - "sha256:54b05fc737ea9c9ee9f8340f579e5da5b09fb64fd010ab5757eb90268616907c", - "sha256:b7a8ec323ee02fb2312f098b6b4c9de99559b462775bc8fe3627a73706603c1b" + "sha256:147b43894e51dd6bba882cf9c282447f780e2251cd35172403745fc381a0a80d", + "sha256:2be72df684b74df0ea47679a7df93fd0e04e72520022c57b479d8f881485dbe3" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==20.2.2" + "version": "==20.4.2" } } } diff --git a/hypixelio/__init__.py b/hypixelio/__init__.py index cbfe6e1..35d1b0d 100644 --- a/hypixelio/__init__.py +++ b/hypixelio/__init__.py @@ -6,4 +6,4 @@ __email__ = "warriordefenderz@gmail.com" __version__ = "1.1.1" __licence__ = "GPL-3.0 License" -__copyright__ = "Copyright 2020 Sunrit Jana" +__copyright__ = "Copyright 2021 Sunrit Jana" diff --git a/hypixelio/exceptions/exceptions.py b/hypixelio/exceptions/exceptions.py index 1a165cf..bd2120e 100644 --- a/hypixelio/exceptions/exceptions.py +++ b/hypixelio/exceptions/exceptions.py @@ -6,10 +6,13 @@ import typing as t +class InvalidArgumentError(Exception): + """Raised when there is Invalid argument, or Any argument is not specified.""" + pass + + class HypixelAPIError(Exception): - """ - Raised When the Hypixel API is facing some problems. - """ + """Raised When the Hypixel API is facing some problems.""" def __init__(self, reason: str = "undefined") -> None: """ Constructor for the HypixelAPIError Exception. @@ -25,12 +28,10 @@ def __str__(self) -> str: class CrafatarAPIError(Exception): - """ - Raised When the Hypixel API is facing some problems. - """ + """Raised When the Crafatar API is facing some problems.""" def __init__(self, reason: str = "undefined") -> None: """ - Constructor for the HypixelAPIError Exception. + Constructor for the CrafatarAPIError Exception. Args: reason (str, optional): The reason for the Error. Defaults to "undefined". @@ -43,9 +44,7 @@ def __str__(self) -> str: class RateLimitError(Exception): - """ - Raised When the Hypixel API Rate limit is hit. - """ + """Raised When the Hypixel API Rate limit is hit.""" def __init__(self, reason: str = "undefined") -> None: """ Constructor for the RateLimitError exception. @@ -61,9 +60,7 @@ def __str__(self) -> str: class PlayerNotFoundError(Exception): - """ - Raised When the Specified Player is not found. - """ + """Raised When the Specified Player is not found.""" def __init__(self, reason: str, user: t.Optional[str]) -> None: """ The constructor for the PlayerNotFoundError exception. @@ -83,9 +80,7 @@ def __str__(self) -> str: class GuildNotFoundError(Exception): - """ - Raised When the Specified Guild is not found. - """ + """Raised When the Specified Guild is not found.""" def __init__(self, reason: str = "undefined") -> None: """ The constructor for the GuildNotFoundError exception. @@ -100,15 +95,8 @@ def __str__(self) -> str: return self.err -class InvalidArgumentError(Exception): - """Raised when there is Invalid argument, or Any argument is not specified.""" - pass - - class MojangAPIError(Exception): - """ - Raised When the Mojang API is facing some problems. - """ + """Raised when the Mojang API is facing some problems.""" def __init__(self, reason: str = "undefined") -> None: """ The constructor for the MojanAPIError Exception. diff --git a/hypixelio/models/boosters/booster_info.py b/hypixelio/models/boosters/booster_info.py index b0c8310..4d698fe 100644 --- a/hypixelio/models/boosters/booster_info.py +++ b/hypixelio/models/boosters/booster_info.py @@ -2,9 +2,7 @@ class BoosterInfo: - """ - This is the Custom Hypixel API Booster's Info Model. - """ + """The Hypixel API Booster's Info Model.""" def __init__( self, info: dict diff --git a/hypixelio/models/boosters/boosters.py b/hypixelio/models/boosters/boosters.py index aea2f60..5a61567 100644 --- a/hypixelio/models/boosters/boosters.py +++ b/hypixelio/models/boosters/boosters.py @@ -6,9 +6,7 @@ class Boosters: - """ - This is the Custom Hypixel API Boosters Model. - """ + """The the Custom Hypixel API Boosters Model.""" def __init__( self, boosters: list, diff --git a/hypixelio/models/caching/backend.py b/hypixelio/models/caching/backend.py index 532d74e..aa0eb08 100644 --- a/hypixelio/models/caching/backend.py +++ b/hypixelio/models/caching/backend.py @@ -3,9 +3,7 @@ @dataclass class CacheBackend: - """ - The Backend Adapters avilable for the caching. - """ + """The Backend Adapters available for the caching.""" sqlite: str = "sqlite" mongodb: str = "mongodb" redis: str = "redis" diff --git a/hypixelio/models/caching/caching.py b/hypixelio/models/caching/caching.py index e825cf4..e727f95 100644 --- a/hypixelio/models/caching/caching.py +++ b/hypixelio/models/caching/caching.py @@ -6,9 +6,7 @@ class Caching: - """ - This is the Custom Caching model, for the Hypixel Requests to be made. - """ + """The Caching model for the Hypixel requests to be made and cached to save the request calls..""" def __init__( self, cache_name: str = "cache", @@ -30,13 +28,13 @@ def __init__( self.expire_after = expire_after self.old_data_on_error = old_data_on_error - def remove_expired_responses(self) -> None: - """ - Remove the expired responses stored in the cache. - """ + @staticmethod + def remove_expired_responses() -> None: + """Remove the expired responses stored in the cache.""" core.remove_expired_responses() - def get_cache(self) -> core.CachedSession: + @staticmethod + def get_cache() -> core.CachedSession: """ Get the cache, which is currently stored and being used. @@ -45,16 +43,14 @@ def get_cache(self) -> core.CachedSession: """ return core.get_cache() - def clear_cache(self) -> None: - """ - Clear the cache stored in the storage specified. - """ + @staticmethod + def clear_cache() -> None: + """Clear the cache stored in the storage specified.""" core.clear() - def uninstall_cache(self) -> None: - """ - Remove caching from your code, if added or integrated. - """ + @staticmethod + def uninstall_cache() -> None: + """Remove caching from your code, if added or integrated.""" core.uninstall_cache() def __str__(self) -> str: diff --git a/hypixelio/models/friends/friends.py b/hypixelio/models/friends/friends.py index 9d834b0..77b8345 100644 --- a/hypixelio/models/friends/friends.py +++ b/hypixelio/models/friends/friends.py @@ -6,9 +6,7 @@ class Friends: - """ - This is the Custom Hypixel API Friends Model. - """ + """The the Custom Hypixel API Friends Model.""" def __init__( self, friends: list diff --git a/hypixelio/utils/constants.py b/hypixelio/utils/constants.py index b13eaf8..f1e4ceb 100644 --- a/hypixelio/utils/constants.py +++ b/hypixelio/utils/constants.py @@ -3,7 +3,6 @@ used all over the code, hence reusing the same things, Instead of redefining, and accessing from a single place. """ - HYPIXEL_API = "https://api.hypixel.net" MOJANG_API = "https://api.mojang.com" diff --git a/hypixelio/utils/helpers.py b/hypixelio/utils/helpers.py index e9dd526..9c0c11a 100644 --- a/hypixelio/utils/helpers.py +++ b/hypixelio/utils/helpers.py @@ -1,7 +1,7 @@ """ This module is dedicated to the storage of the Helper functions, -Which is imported in the main file: `Client.py` to include in the functions -to Reduce the lines of code, and simplify it. +Which is imported in the main file: `client.py` to include in the functions +to reduce the lines of code, and simplify it. """ @@ -11,8 +11,9 @@ def form_url(main_url: str, url: str, data: dict = None) -> str: Args: main_url (str): The Main URL With the root domain. - url (str): The Route in the Main URL to acess the JSON From. - data (dict, optional): he GET Request Key Value pair, Added to end of the Final route specified in the main_url + url.. Defaults to None. + url (str): The Route in the Main URL to access the JSON From. + data (dict, optional): The GET Request Key Value pair, Added to end of the Final route specified in the main_url + + url.. Defaults to None. Returns: str: The Final URL with the Get request parameters, and the URL Route. From 29a888a108f4ec84a0411b783ee353346c2f2cff Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 12:33:11 +0530 Subject: [PATCH 02/55] Refactor the object models. --- hypixelio/models/find_guild.py | 4 +--- hypixelio/models/games/games.py | 3 ++- hypixelio/models/guild.py | 4 +--- hypixelio/models/key.py | 4 +--- hypixelio/models/leaderboard/leaderboard.py | 4 +--- hypixelio/models/leaderboard/leaderboard_data.py | 4 +--- hypixelio/models/player.py | 4 +--- 7 files changed, 8 insertions(+), 19 deletions(-) diff --git a/hypixelio/models/find_guild.py b/hypixelio/models/find_guild.py index 09d47a1..65d6d35 100644 --- a/hypixelio/models/find_guild.py +++ b/hypixelio/models/find_guild.py @@ -2,9 +2,7 @@ class FindGuild: - """ - This is the Custom Hypixel Find Guild Model. - """ + """This is the Custom Hypixel model for looking up guilds.""" def __init__( self, data: dict diff --git a/hypixelio/models/games/games.py b/hypixelio/models/games/games.py index 76f08dc..4f91384 100644 --- a/hypixelio/models/games/games.py +++ b/hypixelio/models/games/games.py @@ -50,4 +50,5 @@ def __init__( self.QUEUE = GameCount(games["QUEUE"]) def __repr__(self) -> str: - return f'<{self.__class__.__name__} lobby={self.MAIN_LOBBY} idle={self.IDLE} queue={self.QUEUE}>' + return f'<{self.__class__.__name__} lobby={self.MAIN_LOBBY} idle={self.IDLE} queue={self.QUEUE} ' \ + f'players={self.PLAYER_COUNT}>' diff --git a/hypixelio/models/guild.py b/hypixelio/models/guild.py index 214c8c3..b70b8be 100644 --- a/hypixelio/models/guild.py +++ b/hypixelio/models/guild.py @@ -2,9 +2,7 @@ class Guild: - """ - This is the Custom Hypixel Guild Model. - """ + """The the Custom Hypixel Guild Model.""" def __init__( self, data: dict diff --git a/hypixelio/models/key.py b/hypixelio/models/key.py index 131bedc..e2c63d6 100644 --- a/hypixelio/models/key.py +++ b/hypixelio/models/key.py @@ -2,9 +2,7 @@ class Key: - """ - This is the Custom Hypixel API Key Model. - """ + """This is the Custom Hypixel API Key Model.""" def __init__( self, data: dict diff --git a/hypixelio/models/leaderboard/leaderboard.py b/hypixelio/models/leaderboard/leaderboard.py index 3c1ca80..3e9ee52 100644 --- a/hypixelio/models/leaderboard/leaderboard.py +++ b/hypixelio/models/leaderboard/leaderboard.py @@ -4,9 +4,7 @@ class Leaderboard: - """ - This is the definition of the Custom Hypixel API Leaderboard Model. - """ + """This is the definition of the Custom Hypixel API Leaderboard Model.""" def __init__( self, board: dict, diff --git a/hypixelio/models/leaderboard/leaderboard_data.py b/hypixelio/models/leaderboard/leaderboard_data.py index 12134ea..5e11889 100644 --- a/hypixelio/models/leaderboard/leaderboard_data.py +++ b/hypixelio/models/leaderboard/leaderboard_data.py @@ -2,9 +2,7 @@ class LeaderboardData: - """ - This is the definition of the Custom Hypixel API Leaderboard Data Model. - """ + """This is the Custom Hypixel API Leaderboard Data Model.""" def __init__( self, data: dict, diff --git a/hypixelio/models/player.py b/hypixelio/models/player.py index b00d831..cce3f70 100644 --- a/hypixelio/models/player.py +++ b/hypixelio/models/player.py @@ -2,9 +2,7 @@ class Player: - """ - This is the Custom Hypixel Player Model. - """ + """The the Custom Hypixel Player Model.""" def __init__( self, data: dict From 04048a16673f03861b4d2a1e79799b0d80bce304 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 12:39:20 +0530 Subject: [PATCH 03/55] Work on fixing documentation temporarily for now. --- hypixelio/lib/client.py | 17 ++++++++--------- hypixelio/lib/converters.py | 4 ++-- hypixelio/lib/utils.py | 3 ++- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hypixelio/lib/client.py b/hypixelio/lib/client.py index d6ba986..751ebda 100644 --- a/hypixelio/lib/client.py +++ b/hypixelio/lib/client.py @@ -33,9 +33,7 @@ class Client: - """ - This Client Contains the Authentication, and Request system for the Hypixel API. - """ + """The client for this wrapper, that handles the requests, authentication, loading and usages of the end user.""" def __init__(self, api_key: t.Union[str, list], cache: bool = False, cache_config: caching.Caching = None) -> None: """ The constructor for the `Client` class. @@ -65,14 +63,16 @@ def _fetch(self, url: str, data: dict = None) -> t.Tuple[dict, bool]: Args: url (str): The URL to be accessed from the Root Domain. - data (dict, optional): The GET Request's Key-Value Pair. Example: {"uuid": "abc"} is converted to `?uuid=abc`. Defaults to None. + data (dict, optional): The GET Request's Key-Value Pair. Example: {"uuid": "abc"} is converted to + `?uuid=abc`. Defaults to None. Raises: RateLimitError: Raised, When a certain user, or API Key is being ratelimited from the API. HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. Returns: - t.Tuple[dict, bool]: The JSON Response from the Fetch Done to the API and the SUCCESS Value from the Response. + t.Tuple[dict, bool]: The JSON Response from the Fetch Done to the API and the SUCCESS Value from the + Response. """ if not data: data = {} @@ -99,7 +99,7 @@ def get_key_info(self, api_key: t.Optional[str] = None) -> key.Key: Args: api_key (t.Optional[str], optional): The API Key generated in Hypixel using `/api new` command. Defaults to - None. + None. Raises: HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. @@ -149,7 +149,7 @@ def get_player(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) Raises: InvalidArgumentError: Returned when either UUID or Username are not provided. HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. - PlayerNotFoundError: Raised, When a ceratin Player is not found. + PlayerNotFoundError: Raised, When a certain Player is not found. Returns: player.Player: The Player Class Object, Which depicts the Player Data Model @@ -209,7 +209,7 @@ def get_watchdog_info(self) -> watchdog.Watchdog: Returns: watchdog.Watchdog: The Watchdog data model with certain important attributes for you to get data about the - things by watchdog. + things by watchdog. """ json, success = self._fetch("/watchdogstats") @@ -300,7 +300,6 @@ def find_guild( """ Finds the Guild By the Guild's Name or using a Player's UUID - Args: guild_name (t.Optional[str], optional): The name of the Guild. Defaults to None. player_uuid (t.Optional[str], optional): The UUID of the Player to find his guild. Defaults to None. diff --git a/hypixelio/lib/converters.py b/hypixelio/lib/converters.py index cac6a61..6a6f289 100644 --- a/hypixelio/lib/converters.py +++ b/hypixelio/lib/converters.py @@ -48,7 +48,7 @@ def username_to_uuid(cls, username: str) -> str: Raises: MojangAPIError: Raised when there seems to be some problem with the Mojang API, which is contacted, - for this conversion. + for this conversion. Returns: str: returns the converted UUID for the respective username. @@ -70,7 +70,7 @@ def uuid_to_username(cls, uuid: str) -> str: Raises: MojangAPIError: Raised when there seems to be some problem with the Mojang API, which is contacted, - for this conversion. + for this conversion. Returns: str: The username for the respective minecraft UUID is returned. diff --git a/hypixelio/lib/utils.py b/hypixelio/lib/utils.py index bb611bf..0a47fa5 100644 --- a/hypixelio/lib/utils.py +++ b/hypixelio/lib/utils.py @@ -53,7 +53,8 @@ def _crafatar_fetch(cls, url: str) -> Response: Raises: InvalidArgumentError: Raised When there is an invalid URL, or Response, whose code is not 200. - CrafatarAPIError: Raised when the Crafatar API is facing some problems, or there is some issues with the status. + CrafatarAPIError: Raised when the Crafatar API is facing some problems, or there is some issues with the + status. Returns: t.Optional[dict]: The JSON response from the Crafatar API, Which is returned. From cc2d32d4e9be1bea723334ef874fc507f9522f3e Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 13:59:40 +0530 Subject: [PATCH 04/55] Start refactoring using endpoints dict. Refactored the utility methods. --- hypixelio/endpoints.py | 26 ++++++++++++++++ hypixelio/lib/client.py | 36 ++++++---------------- hypixelio/lib/converters.py | 2 +- hypixelio/lib/utils.py | 59 ++++++++++--------------------------- setup.py | 14 +++++---- 5 files changed, 59 insertions(+), 78 deletions(-) create mode 100644 hypixelio/endpoints.py diff --git a/hypixelio/endpoints.py b/hypixelio/endpoints.py new file mode 100644 index 0000000..a3673a8 --- /dev/null +++ b/hypixelio/endpoints.py @@ -0,0 +1,26 @@ +"""List of all the various endpoint paths.""" + +API_PATH = { + "HYPIXEL": { + "api_key": "/key", + "boosters": "/boosters", + "player": "/player", + "friends": "/friends", + "watchdog": "/watchdogstats", + "guild": "/guild", + "game_info": "/gameCounts", + "leaderboards": "/leaderboards", + "find_guild": "/findGuild" + }, + "MOJANG": { + "username_to_uuid": "/users/profiles/minecraft/{username}", + "uuid_to_username": "/user/profiles/{uuid}/names", + "name_history": "/user/profiles/{uuid}/names", + }, + "CRAFATAR": { + "avatar": "/avatars/{}", + "head": "/renders/head/{}", + "body": "/renders/body/{}", + "skins": "/skins/{}" + } +} diff --git a/hypixelio/lib/client.py b/hypixelio/lib/client.py index 751ebda..c5c4bf7 100644 --- a/hypixelio/lib/client.py +++ b/hypixelio/lib/client.py @@ -115,9 +115,7 @@ def get_key_info(self, api_key: t.Optional[str] = None) -> key.Key: if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - return key.Key( - json["record"] - ) + return key.Key(json["record"]) def get_boosters(self) -> boosters.Boosters: """ @@ -134,9 +132,7 @@ def get_boosters(self) -> boosters.Boosters: if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - return boosters.Boosters( - json["boosters"] - ) + return boosters.Boosters(json["boosters"]) def get_player(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> player.Player: """ @@ -163,15 +159,12 @@ def get_player(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) if not success: raise HypixelAPIError( - f"The Key given is invalid, or something else has problem. Reason given: {json['cause']}" - ) + f"The Key given is invalid, or something else has problem. Reason given: {json['cause']}") if not json["player"]: raise PlayerNotFoundError("Null Value is returned", name) - return player.Player( - json["player"] - ) + return player.Player(json["player"]) def get_friends(self, uuid: t.Optional[str] = None) -> friends.Friends: """ @@ -196,9 +189,7 @@ def get_friends(self, uuid: t.Optional[str] = None) -> friends.Friends: if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - return friends.Friends( - json["records"] - ) + return friends.Friends(json["records"]) def get_watchdog_info(self) -> watchdog.Watchdog: """ @@ -214,13 +205,9 @@ def get_watchdog_info(self) -> watchdog.Watchdog: json, success = self._fetch("/watchdogstats") if not success: - raise HypixelAPIError( - f"The Key given is invalid, or something else has problem. Cause: {json['cause']}" - ) + raise HypixelAPIError(f"The Key given is invalid, or something else has problem. Cause: {json['cause']}") - return watchdog.Watchdog( - json - ) + return watchdog.Watchdog(json) def get_guild(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> guild.Guild: """ @@ -270,10 +257,7 @@ def get_games_info(self) -> games.Games: if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - return games.Games( - json["games"], - json["playerCount"] - ) + return games.Games(json["games"], json["playerCount"]) def get_leaderboards(self) -> leaderboard.Leaderboard: """ @@ -290,9 +274,7 @@ def get_leaderboards(self) -> leaderboard.Leaderboard: if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - return leaderboard.Leaderboard( - json["leaderboards"] - ) + return leaderboard.Leaderboard(json["leaderboards"]) def find_guild( self, guild_name: t.Optional[str] = None, player_uuid: t.Optional[str] = None diff --git a/hypixelio/lib/converters.py b/hypixelio/lib/converters.py index 6a6f289..756d06c 100644 --- a/hypixelio/lib/converters.py +++ b/hypixelio/lib/converters.py @@ -36,7 +36,7 @@ def _fetch(cls, url: str) -> t.Optional[dict]: json = response.json() return json except Exception: - raise MojangAPIError("There seems to be some problem with the content type or the API IS down.") + raise MojangAPIError("There seems to be some problem with the content type or the API is down.") @classmethod def username_to_uuid(cls, username: str) -> str: diff --git a/hypixelio/lib/utils.py b/hypixelio/lib/utils.py index 0a47fa5..7acb3a3 100644 --- a/hypixelio/lib/utils.py +++ b/hypixelio/lib/utils.py @@ -3,45 +3,22 @@ import requests from requests.models import Response +from hypixelio.endpoints import API_PATH from hypixelio.exceptions.exceptions import ( CrafatarAPIError, InvalidArgumentError, - MojangAPIError, ) from hypixelio.lib.converters import ( Converters ) from hypixelio.utils.constants import ( - MOJANG_API, TIMEOUT ) class Utils: - @classmethod - def _fetch(cls, url: str) -> t.Optional[dict]: - """ - This is the function for fetching the JSON from the Mojang API. - - Args: - url (str): The Mojang URL, whose JSON is supposed to be fetched. - - Raises: - InvalidArgumentError: Raised When there is an invalid URL, or Response, whose code is not 200. - MojangAPIError: Raised when the Mojang API is facing some problems, or there is some issues with the status. - - Returns: - t.Optional[dict]: The JSON response from the Mojang API, Which is returned. - """ - with requests.get(f"{MOJANG_API}{url}", timeout=TIMEOUT) as response: - if response.status_code != 200: - raise InvalidArgumentError("Invalid data passed for conversion!") - - try: - json = response.json() - return json - except Exception: - raise MojangAPIError("There seems to be some problem with the content type or the API IS down.") + mojang_url = API_PATH["MOJANG"] + url = API_PATH["CRAFATAR"] @classmethod def _crafatar_fetch(cls, url: str) -> Response: @@ -79,7 +56,7 @@ def _form_crafatar_url(cls, route: str) -> str: Returns: str: The well formed API URL for fetching. """ - return f"https://crafatar.com/{route}" + return f"https://crafatar.com{route}" @classmethod def get_name_history( @@ -101,9 +78,9 @@ def get_name_history( """ if name: uuid = Converters.username_to_uuid(name) - json = Utils._fetch(f"/user/profiles/{uuid}/names") + json = Converters._fetch(Utils.mojang_url["name_history"].format(uuid)) elif uuid: - json = Utils._fetch(f"/user/profiles/{uuid}/names") + json = Converters._fetch(Utils.mojang_url["name_history"].format(uuid)) else: raise InvalidArgumentError("Please provide a Named argument of the User's name or UUID.") @@ -131,17 +108,15 @@ def get_avatar(cls, name: t.Optional[str] = None, uuid: t.Optional[str] = None) Returns: str: The URL containing the image of the avatar. """ - url = "/avatars/{}" - if name: uuid = Converters.username_to_uuid(name) - Utils._crafatar_fetch(url.format(uuid)) + Utils._crafatar_fetch(Utils.url["avatar"].format(uuid)) elif uuid: - Utils._crafatar_fetch(url.format(uuid)) + Utils._crafatar_fetch(Utils.url["avatar"].format(uuid)) else: raise InvalidArgumentError("Please provide a Named argument of the User's name or UUID.") - return Utils._form_crafatar_url(url.format(uuid)) + return Utils._form_crafatar_url(Utils.url["avatar"].format(uuid)) @classmethod def get_head(cls, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> str: @@ -158,17 +133,15 @@ def get_head(cls, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> Returns: str: The URL containing the image of the head. """ - url = "/renders/head/{}" - if name: uuid = Converters.username_to_uuid(name) - Utils._crafatar_fetch(url.format(uuid)) + Utils._crafatar_fetch(Utils.url["head"].format(uuid)) elif uuid: - Utils._crafatar_fetch(url.format(uuid)) + Utils._crafatar_fetch(Utils.url["head"].format(uuid)) else: raise InvalidArgumentError("Please provide a Named argument of the User's name or UUID.") - return Utils._form_crafatar_url(url.format(uuid)) + return Utils._form_crafatar_url(Utils.url["head"].format(uuid)) @classmethod def get_body(cls, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> str: @@ -185,14 +158,12 @@ def get_body(cls, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> Returns: str: The URL containing the image of the whole body. """ - url = "/renders/body/{}" - if name: uuid = Converters.username_to_uuid(name) - Utils._crafatar_fetch(url.format(uuid)) + Utils._crafatar_fetch(Utils.url["body"].format(uuid)) elif uuid: - Utils._crafatar_fetch(url.format(uuid)) + Utils._crafatar_fetch(Utils.url["body"].format(uuid)) else: raise InvalidArgumentError("Please provide a Named argument of the User's name or UUID.") - return Utils._form_crafatar_url(url.format(uuid)) + return Utils._form_crafatar_url(Utils.url["body"].format(uuid)) diff --git a/setup.py b/setup.py index e19a00a..80bc002 100644 --- a/setup.py +++ b/setup.py @@ -3,10 +3,12 @@ import setuptools +# -- Constants -- BASE_DIR = Path(__file__).resolve().parent - README = Path(BASE_DIR / "README.md").read_text() +URL = "https://github.com/janaSunrise/HypixelIO" +# -- Version config -- VERSION = re.search( r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', Path(BASE_DIR / "hypixelio/__init__.py").read_text(), @@ -14,7 +16,7 @@ ).group(1) if not VERSION: - raise RuntimeError('version is not set') + raise RuntimeError("VERSION is not set!") setuptools.setup( name="HypixelIO", @@ -23,16 +25,16 @@ author="Sunrit Jana", author_email="warriordefenderz@gmail.com", - description="A modern efficient and faster way of interacting with the Hypixel API!", + description="A modern, efficient and faster way of interacting with the Hypixel API!", long_description=README, long_description_content_type="text/markdown", license="GPL v3", - url="https://github.com/janaSunrise/HypixelIO", + url=URL, project_urls={ - "Documentation": "https://github.com/janaSunrise/HypixelIO", - "Issue tracker": "https://github.com/janaSunrise/HypixelIO/issues", + "Documentation": URL, + "Issue tracker": f"{URL}/issues", }, packages=setuptools.find_packages( From 98bd84f75f746ff343e6f4f78c326781721277f5 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 14:04:37 +0530 Subject: [PATCH 05/55] Refactor converters. --- hypixelio/lib/converters.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hypixelio/lib/converters.py b/hypixelio/lib/converters.py index 756d06c..82ec491 100644 --- a/hypixelio/lib/converters.py +++ b/hypixelio/lib/converters.py @@ -2,6 +2,7 @@ import requests +from hypixelio.endpoints import API_PATH from hypixelio.exceptions.exceptions import ( InvalidArgumentError, MojangAPIError @@ -13,6 +14,8 @@ class Converters: + url = API_PATH["MOJANG"] + @classmethod def _fetch(cls, url: str) -> t.Optional[dict]: """ @@ -53,11 +56,10 @@ def username_to_uuid(cls, username: str) -> str: Returns: str: returns the converted UUID for the respective username. """ - json = Converters._fetch(f"/users/profiles/minecraft/{username}") + json = Converters._fetch(Converters.url["username_to_uuid"].format(username)) if "error" in json: raise MojangAPIError(f"An error occurred! {json['errorMessage']}") - return json["id"] @classmethod @@ -75,9 +77,8 @@ def uuid_to_username(cls, uuid: str) -> str: Returns: str: The username for the respective minecraft UUID is returned. """ - json = Converters._fetch(f"/user/profiles/{uuid}/names") + json = Converters._fetch(Converters.url["uuid_to_username"].format(uuid)) if "error" in json: raise MojangAPIError(f"An error occurred! {json['errorMessage']}") - return json[-1]["name"] From eb883b893a67b5cbd784e7646b649b1143d26721 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 14:06:50 +0530 Subject: [PATCH 06/55] Fix the formatting issue. --- hypixelio/endpoints.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hypixelio/endpoints.py b/hypixelio/endpoints.py index a3673a8..6ea661a 100644 --- a/hypixelio/endpoints.py +++ b/hypixelio/endpoints.py @@ -13,9 +13,9 @@ "find_guild": "/findGuild" }, "MOJANG": { - "username_to_uuid": "/users/profiles/minecraft/{username}", - "uuid_to_username": "/user/profiles/{uuid}/names", - "name_history": "/user/profiles/{uuid}/names", + "username_to_uuid": "/users/profiles/minecraft/{}", + "uuid_to_username": "/user/profiles/{}/names", + "name_history": "/user/profiles/{}/names", }, "CRAFATAR": { "avatar": "/avatars/{}", From 8df52467302a7105de4c82d8f6bbd458ce00a456 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 14:15:34 +0530 Subject: [PATCH 07/55] Add the endpoints paths to client. --- hypixelio/lib/client.py | 44 ++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/hypixelio/lib/client.py b/hypixelio/lib/client.py index c5c4bf7..2bef32e 100644 --- a/hypixelio/lib/client.py +++ b/hypixelio/lib/client.py @@ -4,6 +4,7 @@ import requests import requests_cache +from hypixelio.endpoints import API_PATH from hypixelio.exceptions import ( GuildNotFoundError, HypixelAPIError, @@ -44,6 +45,8 @@ def __init__(self, api_key: t.Union[str, list], cache: bool = False, cache_confi cache_config (caching.Caching, optional): The configuration for the saving, and reusing of the cache. Defaults to None. """ + self.url = API_PATH["HYPIXEL"] + if not isinstance(api_key, list): self.api_key = [api_key] @@ -110,11 +113,10 @@ def get_key_info(self, api_key: t.Optional[str] = None) -> key.Key: if not api_key: api_key = random.choice(self.api_key) - json, success = self._fetch("/key", {"key": api_key}) + json, success = self._fetch(self.url["api_key"], {"key": api_key}) if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - return key.Key(json["record"]) def get_boosters(self) -> boosters.Boosters: @@ -127,11 +129,10 @@ def get_boosters(self) -> boosters.Boosters: Returns: boosters.Boosters: The Booster Class Object, Which depicts the Booster Data Model. """ - json, success = self._fetch("/boosters") + json, success = self._fetch(self.url["boosters"]) if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - return boosters.Boosters(json["boosters"]) def get_player(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> player.Player: @@ -151,9 +152,9 @@ def get_player(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) player.Player: The Player Class Object, Which depicts the Player Data Model """ if name: - json, success = self._fetch("/player", {"name": name}) + json, success = self._fetch(self.url["player"], {"name": name}) elif uuid: - json, success = self._fetch("/player", {"uuid": uuid}) + json, success = self._fetch(self.url["player"], {"uuid": uuid}) else: raise InvalidArgumentError("Please provide a named argument of the player's username or player's UUID.") @@ -163,7 +164,6 @@ def get_player(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) if not json["player"]: raise PlayerNotFoundError("Null Value is returned", name) - return player.Player(json["player"]) def get_friends(self, uuid: t.Optional[str] = None) -> friends.Friends: @@ -182,13 +182,12 @@ def get_friends(self, uuid: t.Optional[str] = None) -> friends.Friends: Attributes. """ if uuid: - json, success = self._fetch("/friends", {"uuid": uuid}) + json, success = self._fetch(self.url["friends"], {"uuid": uuid}) else: raise InvalidArgumentError("Please provide a Named argument of the player's UUID") if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - return friends.Friends(json["records"]) def get_watchdog_info(self) -> watchdog.Watchdog: @@ -202,11 +201,10 @@ def get_watchdog_info(self) -> watchdog.Watchdog: watchdog.Watchdog: The Watchdog data model with certain important attributes for you to get data about the things by watchdog. """ - json, success = self._fetch("/watchdogstats") + json, success = self._fetch(self.url["watchdog"]) if not success: raise HypixelAPIError(f"The Key given is invalid, or something else has problem. Cause: {json['cause']}") - return watchdog.Watchdog(json) def get_guild(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> guild.Guild: @@ -226,9 +224,9 @@ def get_guild(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) guild.Guild: The Guild Object with certain Attributes for you to access, and use it. """ if uuid: - json, success = self._fetch("/guild", {"id": uuid}) + json, success = self._fetch(self.url["guild"], {"id": uuid}) elif name: - json, success = self._fetch("/guild", {"name": name}) + json, success = self._fetch(self.url["guild"], {"name": name}) else: raise InvalidArgumentError("Please provide a Named argument of the guild's Name or guild's ID.") @@ -237,10 +235,7 @@ def get_guild(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) if not json["guild"]: raise GuildNotFoundError("Return Value is null") - - return guild.Guild( - json["guild"] - ) + return guild.Guild(json["guild"]) def get_games_info(self) -> games.Games: """ @@ -252,11 +247,10 @@ def get_games_info(self) -> games.Games: Returns: games.Games: The Games Data model, Containing the information, and attributes for all the games. """ - json, success = self._fetch("/gameCounts") + json, success = self._fetch(self.url["game_info"]) if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - return games.Games(json["games"], json["playerCount"]) def get_leaderboards(self) -> leaderboard.Leaderboard: @@ -269,11 +263,10 @@ def get_leaderboards(self) -> leaderboard.Leaderboard: Returns: leaderboard.Leaderboard: The Leaderboard data model, containing all the ranking for the games in Hypixel. """ - json, success = self._fetch("/leaderboards") + json, success = self._fetch(self.url["leaderboards"]) if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - return leaderboard.Leaderboard(json["leaderboards"]) def find_guild( @@ -294,15 +287,12 @@ def find_guild( find_guild.FindGuild: The ID of the guild being find. """ if guild_name: - json, success = self._fetch("/findGuild", {"byName": guild_name}) + json, success = self._fetch(self.url["find_guild"], {"byName": guild_name}) elif player_uuid: - json, success = self._fetch("/findGuild", {"byUuid": player_uuid}) + json, success = self._fetch(self.url["find_guild"], {"byUuid": player_uuid}) else: raise InvalidArgumentError("Please provide a Named argument of the guild's Name or guild's ID.") if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - - return find_guild.FindGuild( - json - ) + return find_guild.FindGuild(json) From 7f5e1b5711865c573cd01b0a5e104713e5c4beec Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 14:17:56 +0530 Subject: [PATCH 08/55] Add deepsource for scanning. --- .deepsource.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .deepsource.toml diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 0000000..4c56386 --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,12 @@ +version = 1 + +[[analyzers]] +name = "python" +enabled = true + + [analyzers.meta] + runtime_version = "3.x.x" + +[[analyzers]] +name = "secrets" +enabled = true \ No newline at end of file From c1a0f43303719b7b3f74cbfd51cd79245e5310c0 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 5 Mar 2021 08:51:27 +0000 Subject: [PATCH 09/55] Autofix issues in 3 files Resolved issues in the following files via DeepSource Autofix: 1. hypixelio/exceptions/exceptions.py 2. hypixelio/lib/utils.py 3. hypixelio/models/boosters/booster_info.py --- hypixelio/exceptions/exceptions.py | 1 - hypixelio/lib/utils.py | 9 ++++----- hypixelio/models/boosters/booster_info.py | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hypixelio/exceptions/exceptions.py b/hypixelio/exceptions/exceptions.py index bd2120e..92875ee 100644 --- a/hypixelio/exceptions/exceptions.py +++ b/hypixelio/exceptions/exceptions.py @@ -8,7 +8,6 @@ class InvalidArgumentError(Exception): """Raised when there is Invalid argument, or Any argument is not specified.""" - pass class HypixelAPIError(Exception): diff --git a/hypixelio/lib/utils.py b/hypixelio/lib/utils.py index 7acb3a3..453968c 100644 --- a/hypixelio/lib/utils.py +++ b/hypixelio/lib/utils.py @@ -86,12 +86,11 @@ def get_name_history( if changed_at: return json - else: - usernames = [] - for data in json: - usernames.append(data["name"]) + usernames = [] + for data in json: + usernames.append(data["name"]) - return usernames + return usernames @classmethod def get_avatar(cls, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> str: diff --git a/hypixelio/models/boosters/booster_info.py b/hypixelio/models/boosters/booster_info.py index 4d698fe..58028c3 100644 --- a/hypixelio/models/boosters/booster_info.py +++ b/hypixelio/models/boosters/booster_info.py @@ -23,7 +23,7 @@ def __init__( self.GAME_TYPE_CODE = info["gameType"] self.DATE_ACTIVATED = info["dateActivated"] - self.STACKED = True if "stacked" in info else False + self.STACKED = "stacked" in info def __eq__(self, other: "BoosterInfo") -> bool: return self.ID == other.ID and self.PURCHASER_UUID == other.PURCHASER_UUID From f30be9ff6fd3637d2fdcf1b39e89ca5cc5132a78 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 14:51:36 +0530 Subject: [PATCH 10/55] Re-write the docstrings. --- hypixelio/exceptions/exceptions.py | 51 ++++++++++--------- hypixelio/models/boosters/booster_info.py | 8 +-- hypixelio/models/boosters/boosters.py | 8 +-- hypixelio/models/caching/caching.py | 17 ++++--- hypixelio/models/find_guild.py | 8 +-- hypixelio/models/friends/friend_data.py | 8 +-- hypixelio/models/friends/friends.py | 8 +-- hypixelio/models/games/game_count.py | 8 +-- hypixelio/models/games/games.py | 11 ++-- hypixelio/models/guild.py | 8 +-- hypixelio/models/key.py | 8 +-- hypixelio/models/leaderboard/leaderboard.py | 8 +-- .../models/leaderboard/leaderboard_data.py | 8 +-- hypixelio/models/player.py | 8 +-- hypixelio/models/watchdog.py | 8 +-- hypixelio/utils/helpers.py | 28 +++++----- 16 files changed, 106 insertions(+), 97 deletions(-) diff --git a/hypixelio/exceptions/exceptions.py b/hypixelio/exceptions/exceptions.py index bd2120e..f86ae66 100644 --- a/hypixelio/exceptions/exceptions.py +++ b/hypixelio/exceptions/exceptions.py @@ -15,10 +15,10 @@ class HypixelAPIError(Exception): """Raised When the Hypixel API is facing some problems.""" def __init__(self, reason: str = "undefined") -> None: """ - Constructor for the HypixelAPIError Exception. - - Args: - reason (str, optional): The reason for the Error. Defaults to "undefined". + Parameters + ---------- + reason: str + The reason for the Error. Defaults to "undefined". """ self.err = f"The Hypixel API had a problem [{reason}]" super().__init__(self.err) @@ -31,10 +31,10 @@ class CrafatarAPIError(Exception): """Raised When the Crafatar API is facing some problems.""" def __init__(self, reason: str = "undefined") -> None: """ - Constructor for the CrafatarAPIError Exception. - - Args: - reason (str, optional): The reason for the Error. Defaults to "undefined". + Parameters + ---------- + reason: str + The reason for the Error. Defaults to "undefined". """ self.err = f"The CrafatarAPI had a problem [{reason}]" super().__init__(self.err) @@ -47,10 +47,10 @@ class RateLimitError(Exception): """Raised When the Hypixel API Rate limit is hit.""" def __init__(self, reason: str = "undefined") -> None: """ - Constructor for the RateLimitError exception. - - Args: - reason (str, optional): The reason for the Error. Defaults to "undefined". + Parameters + ---------- + reason: str + The reason for the Error. Defaults to "undefined". """ self.err = f"You just hit the Rate Limit for the Hypixel API [{reason}]" super().__init__(self.err) @@ -63,11 +63,12 @@ class PlayerNotFoundError(Exception): """Raised When the Specified Player is not found.""" def __init__(self, reason: str, user: t.Optional[str]) -> None: """ - The constructor for the PlayerNotFoundError exception. - - Args: - reason (str): The reason for the error. - user (t.Optional[str]): The user searched for, but not found. + Parameters + ---------- + reason: str + The reason for the error. + user: t.Optional[str] + The user searched for, but not found. """ self.err = "Invalid Player Name!" super().__init__(self.err) @@ -83,10 +84,10 @@ class GuildNotFoundError(Exception): """Raised When the Specified Guild is not found.""" def __init__(self, reason: str = "undefined") -> None: """ - The constructor for the GuildNotFoundError exception. - - Args: - reason (str, optional): The reason for the Error. Defaults to "undefined". + Parameters + ---------- + reason: str + The reason for the Error. Defaults to "undefined". """ self.err = f"Invalid Guild Name or UUID! [{reason}]" super().__init__(self.err) @@ -99,10 +100,10 @@ class MojangAPIError(Exception): """Raised when the Mojang API is facing some problems.""" def __init__(self, reason: str = "undefined") -> None: """ - The constructor for the MojanAPIError Exception. - - Args: - reason (str, optional): The reason for the Error. Defaults to "undefined". + Parameters + ---------- + reason: str + The reason for the Error. Defaults to "undefined". """ self.err = f"The Mojang API had a problem [{reason}]" super().__init__(self.err) diff --git a/hypixelio/models/boosters/booster_info.py b/hypixelio/models/boosters/booster_info.py index 4d698fe..3af31e0 100644 --- a/hypixelio/models/boosters/booster_info.py +++ b/hypixelio/models/boosters/booster_info.py @@ -8,10 +8,10 @@ def __init__( info: dict ) -> None: """ - The constructor for the Hypixel Booster model. - - Args: - info (dict): This contains the Returned JSON Response for the Booster's List Element API Request. + Parameters + ---------- + info: dict + This contains the Returned JSON Response for the Booster's List Element API Request. """ self.ID = info["_id"] self.PURCHASER_UUID = info["purchaserUuid"] diff --git a/hypixelio/models/boosters/boosters.py b/hypixelio/models/boosters/boosters.py index 5a61567..60d9db8 100644 --- a/hypixelio/models/boosters/boosters.py +++ b/hypixelio/models/boosters/boosters.py @@ -12,10 +12,10 @@ def __init__( boosters: list, ) -> None: """ - The constructor for the Booster List model. - - Args: - boosters (list): The list of the Coin Boosters in the Hypixel server. + Parameters + ---------- + boosters: list + The list of the Coin Boosters in the Hypixel server. """ self.BOOSTERS = [BoosterInfo(booster) for booster in boosters] diff --git a/hypixelio/models/caching/caching.py b/hypixelio/models/caching/caching.py index e727f95..7157a41 100644 --- a/hypixelio/models/caching/caching.py +++ b/hypixelio/models/caching/caching.py @@ -15,13 +15,16 @@ def __init__( old_data_on_error: bool = False ) -> None: """ - The Constructor for the Caching Model. - - Args: - cache_name (str, optional): The name of the Cache, Which will be stored. Defaults to "cache". - backend (str, optional): The format of storage of the Cache. Defaults to CacheBackend.memory. - expire_after (int, optional): When will the cahe expire, In seconds. Defaults to None. - old_data_on_error (bool, optional): Whether to use old data, If an error occurs.. Defaults to False. + Parameters + ---------- + cache_name: str + The name of the Cache, Which will be stored. Defaults to "cache". + backend: str + The format of storage of the Cache. Defaults to CacheBackend.memory. + expire_after: int + When will the cache expire, In seconds. Defaults to None. + old_data_on_error: bool + Whether to use old data, If an error occurs. Defaults to False. """ self.cache_name = cache_name self.backend = backend diff --git a/hypixelio/models/find_guild.py b/hypixelio/models/find_guild.py index 65d6d35..78f91dc 100644 --- a/hypixelio/models/find_guild.py +++ b/hypixelio/models/find_guild.py @@ -8,10 +8,10 @@ def __init__( data: dict ) -> None: """ - The constructor for the Hypixel Find Guild Model. - - Args: - data (dict): The JSON data received from the Hypixel API. + Parameters + ---------- + data: dict + The JSON data received from the Hypixel API. """ self.ID = data["guild"] diff --git a/hypixelio/models/friends/friend_data.py b/hypixelio/models/friends/friend_data.py index 028cb67..48ff95f 100644 --- a/hypixelio/models/friends/friend_data.py +++ b/hypixelio/models/friends/friend_data.py @@ -10,10 +10,10 @@ def __init__( friend: dict, ) -> None: """ - The constructor for the Friend Data Hypixel Model. - - Args: - friend (dict): This contains the Returned JSON Response for the Friend's list element API Request. + Parameters + ---------- + friend: dict + This contains the JSON Response for the Friend's list element API Request. """ self.REQUEST_ID = friend['_id'] diff --git a/hypixelio/models/friends/friends.py b/hypixelio/models/friends/friends.py index 77b8345..65dad4d 100644 --- a/hypixelio/models/friends/friends.py +++ b/hypixelio/models/friends/friends.py @@ -12,10 +12,10 @@ def __init__( friends: list ) -> None: """ - The contains for the Friends List model. - - Args: - friends (list): This contains the Returned JSON Response List for the List of the friends of an user. + Parameters + ---------- + friends: list + This contains the Returned JSON Response List for the List of the friends of an user. """ self.FRIENDS = [FriendData(friend) for friend in friends] diff --git a/hypixelio/models/games/game_count.py b/hypixelio/models/games/game_count.py index c0469f3..cf3c631 100644 --- a/hypixelio/models/games/game_count.py +++ b/hypixelio/models/games/game_count.py @@ -10,10 +10,10 @@ def __init__( game: dict ) -> None: """ - The constructor for the GameCount model. - - Args: - game (dict): The Game JSON data response received from the Hypixel API. + Parameters + ---------- + game: dict + The Game JSON data response received from the Hypixel API. """ self.PLAYERS = game["players"] self.MODES = game.get("modes") diff --git a/hypixelio/models/games/games.py b/hypixelio/models/games/games.py index 4f91384..b8ce31e 100644 --- a/hypixelio/models/games/games.py +++ b/hypixelio/models/games/games.py @@ -13,11 +13,12 @@ def __init__( player_count: int, ) -> None: """ - The constructor of the Games model. - - Args: - games (dict): The Games JSON list data response received from the Hypixel API. - player_count (int): The player count in the whole Hypixel Server. + Parameters + ---------- + games: dict + The Games JSON list data response received from the Hypixel API. + player_count: int + The player count in the whole Hypixel Server. """ self.PLAYER_COUNT = player_count diff --git a/hypixelio/models/guild.py b/hypixelio/models/guild.py index b70b8be..dd9676d 100644 --- a/hypixelio/models/guild.py +++ b/hypixelio/models/guild.py @@ -8,10 +8,10 @@ def __init__( data: dict ) -> None: """ - The constructor for the Hypixel Guild Model. - - Args: - data (dict): The JSON data received from the Hypixel API. + Parameters + ---------- + data: dict + The JSON data received from the Hypixel API. """ self.HYPIXEL_ID = data["_id"] self.NAME = data["name"] diff --git a/hypixelio/models/key.py b/hypixelio/models/key.py index e2c63d6..f5b5d2c 100644 --- a/hypixelio/models/key.py +++ b/hypixelio/models/key.py @@ -8,10 +8,10 @@ def __init__( data: dict ) -> None: """ - The constructor for the Hypixel Key Model. - - Args: - data (dict): The JSON data received from the Hypixel API. + Parameters + ---------- + data: dict + The JSON data received from the Hypixel API. """ self.KEY = data["key"] self.OWNER_UUID = data["owner"] diff --git a/hypixelio/models/leaderboard/leaderboard.py b/hypixelio/models/leaderboard/leaderboard.py index 3e9ee52..a52ffe3 100644 --- a/hypixelio/models/leaderboard/leaderboard.py +++ b/hypixelio/models/leaderboard/leaderboard.py @@ -10,10 +10,10 @@ def __init__( board: dict, ) -> None: """ - The constructor for the Leaderboard Model in Hypixel. - - Args: - board (dict): The Leaderboard JSON data response received from the Hypixel API. + Parameters + ---------- + board: dict + The Leaderboard JSON data response received from the Hypixel API. """ self.ARENA = [data(arena) for arena in board['ARENA']] self.MCGO = [data(arena) for arena in board['MCGO']] diff --git a/hypixelio/models/leaderboard/leaderboard_data.py b/hypixelio/models/leaderboard/leaderboard_data.py index 5e11889..c21fa9a 100644 --- a/hypixelio/models/leaderboard/leaderboard_data.py +++ b/hypixelio/models/leaderboard/leaderboard_data.py @@ -8,10 +8,10 @@ def __init__( data: dict, ) -> None: """ - The Constructor for the Leaderboard Data Model for each Game. - - Args: - data (dict): The Leaderboard JSON data per game response received from the Hypixel API. + Parameters + ---------- + data: dict + The Leaderboard JSON data per game response received from the Hypixel API. """ self.PATH = data['path'] self.PREFIX = data['prefix'] diff --git a/hypixelio/models/player.py b/hypixelio/models/player.py index cce3f70..c02dda9 100644 --- a/hypixelio/models/player.py +++ b/hypixelio/models/player.py @@ -8,10 +8,10 @@ def __init__( data: dict ) -> None: """ - The constructor for the Hypixel Player Model. - - Args: - data (dict): The JSON data received from the Hypixel API. + Parameters + ---------- + data: dict + The JSON data received from the Hypixel API. """ self.HYPIXEL_ID = data["_id"] self.UUID = data["uuid"] diff --git a/hypixelio/models/watchdog.py b/hypixelio/models/watchdog.py index 693c084..6bfadda 100644 --- a/hypixelio/models/watchdog.py +++ b/hypixelio/models/watchdog.py @@ -10,10 +10,10 @@ def __init__( data: dict ) -> None: """ - The constructor for the Hypixel Watchdog Model. - - Args: - data (dict): The JSON data received from the Hypixel API. + Parameters + ---------- + data: dict + The JSON data received from the Hypixel API. """ self.LAST_MINUTE_BAN = data["watchdog_lastMinute"] diff --git a/hypixelio/utils/helpers.py b/hypixelio/utils/helpers.py index 9c0c11a..59a6f58 100644 --- a/hypixelio/utils/helpers.py +++ b/hypixelio/utils/helpers.py @@ -9,24 +9,28 @@ def form_url(main_url: str, url: str, data: dict = None) -> str: """ Form and return the URL for the Hypixel API with GET Params. - Args: - main_url (str): The Main URL With the root domain. - url (str): The Route in the Main URL to access the JSON From. - data (dict, optional): The GET Request Key Value pair, Added to end of the Final route specified in the main_url - + url.. Defaults to None. + Parameters + ---------- + main_url: str + The Main URL With the root domain. + url: str + The Route in the Main URL to access the JSON From. + data: t.Optional[dict] + The GET Request Key Value pair, Added to end of the Final route specified in the main_urlv+ url.. Defaults + to None. - Returns: - str: The Final URL with the Get request parameters, and the URL Route. + Returns + ------- + str: + The Final URL with the Get request parameters, and the URL Route. """ if not data: data = {} url = main_url + url if url.startswith('/') else url - url += "?" + "&".join( - [ - f"{dict_key}={dict_value}" for dict_key, dict_value in data.items() - ] - ) + url += "?" + "&".join([ + f"{dict_key}={dict_value}" for dict_key, dict_value in data.items() + ]) return url From 14479f9599bc2175e6d4559201e3c920be9240d0 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 15:04:43 +0530 Subject: [PATCH 11/55] Rewrite the docstrings for lib. --- hypixelio/lib/converters.py | 50 ++++++++-------- hypixelio/lib/utils.py | 114 ++++++++++++++++++++---------------- hypixelio/utils/helpers.py | 2 +- 3 files changed, 89 insertions(+), 77 deletions(-) diff --git a/hypixelio/lib/converters.py b/hypixelio/lib/converters.py index 82ec491..d55ea88 100644 --- a/hypixelio/lib/converters.py +++ b/hypixelio/lib/converters.py @@ -19,17 +19,17 @@ class Converters: @classmethod def _fetch(cls, url: str) -> t.Optional[dict]: """ - This is the function for fetching the JSON from the Mojang API. + This is the internal function for fetching the JSON from the Mojang API. - Args: - url (str): The Mojang URL, whose JSON is supposed to be fetched. + Parameters + ---------- + url: str + The Mojang URL, whose JSON is supposed to be fetched. - Raises: - InvalidArgumentError: Raised When there is an invalid URL, or Response, whose code is not 200. - MojangAPIError: Raised when the Mojang API is facing some problems, or there is some issues with the status. - - Returns: - t.Optional[dict]: The JSON response from the Mojang API, Which is returned. + Returns + ------- + t.Optional[dict] + The JSON response from the Mojang API, Which is returned. """ with requests.get(f"{MOJANG_API}{url}", timeout=TIMEOUT) as response: if response.status_code != 200: @@ -46,15 +46,15 @@ def username_to_uuid(cls, username: str) -> str: """ This is a method, to convert username in minecraft, for its respective UUID. - Args: - username (str): This is the minecraft user, which is passed to this function for the UUID Conversion. - - Raises: - MojangAPIError: Raised when there seems to be some problem with the Mojang API, which is contacted, - for this conversion. + Parameters + ---------- + username: str + This is the minecraft user, which is passed to this function for the UUID Conversion. - Returns: - str: returns the converted UUID for the respective username. + Returns + ------- + str + returns the converted UUID for the respective username. """ json = Converters._fetch(Converters.url["username_to_uuid"].format(username)) @@ -67,15 +67,15 @@ def uuid_to_username(cls, uuid: str) -> str: """ This is the function that converts the UUID for your profile, to the Username for your Minecraft account. - Args: - uuid (str): This is the minecraft UUID, which is passed to this function for the UUID to username Conversion. - - Raises: - MojangAPIError: Raised when there seems to be some problem with the Mojang API, which is contacted, - for this conversion. + Parameters + ---------- + uuid: str + This is the minecraft UUID, which is passed to this function for the UUID to username Conversion. - Returns: - str: The username for the respective minecraft UUID is returned. + Returns + ------- + str + The username for the respective minecraft UUID is returned. """ json = Converters._fetch(Converters.url["uuid_to_username"].format(uuid)) diff --git a/hypixelio/lib/utils.py b/hypixelio/lib/utils.py index 453968c..37bbc05 100644 --- a/hypixelio/lib/utils.py +++ b/hypixelio/lib/utils.py @@ -25,16 +25,15 @@ def _crafatar_fetch(cls, url: str) -> Response: """ This is the function for fetching the JSON from the Crafatar API. - Args: - url (str): The Crafatar URL, whose JSON is supposed to be fetched. - - Raises: - InvalidArgumentError: Raised When there is an invalid URL, or Response, whose code is not 200. - CrafatarAPIError: Raised when the Crafatar API is facing some problems, or there is some issues with the - status. - - Returns: - t.Optional[dict]: The JSON response from the Crafatar API, Which is returned. + Parameters + ---------- + url: str + The Crafatar URL, whose JSON is supposed to be fetched. + + Returns + ------- + t.Optional[dict] + The JSON response from the Crafatar API, which is returned. """ with requests.get(f"https://crafatar.com/{url}", timeout=TIMEOUT) as response: if response.status_code == 422: @@ -50,11 +49,15 @@ def _form_crafatar_url(cls, route: str) -> str: """ This function forms the crafatar API URL for fetching USER skins. - Args: - route (str): The URL path to visit. + Parameters + ---------- + route: str + The URL path to visit. - Returns: - str: The well formed API URL for fetching. + Returns + ------- + str + The well formed API URL for fetching. """ return f"https://crafatar.com{route}" @@ -65,16 +68,19 @@ def get_name_history( """ This get the name history with records of a player. - Args: - name (t.Optional[str], optional): The username of the player. Defaults to None. - uuid (t.Optional[str], optional): The UUID of the player. Defaults to None. - changed_at (bool, optional): Toggle to true, if you need when the player changed name. Defaults to False. - - Raises: - InvalidArgumentError: Raised if neither UUID or username isn't passed. - - Returns: - t.Union[list, dict]: The list or dictionary with the name history and records. + Parameters + ---------- + name: t.Optional[str] + The username of the player. Defaults to None. + uuid: t.Optional[str] + The UUID of the player. Defaults to None. + changed_at: bool + Toggle to true, if you need when the player changed name. Defaults to False. + + Returns + ------- + t.Union[list, dict] + The list or dictionary with the name history and records. """ if name: uuid = Converters.username_to_uuid(name) @@ -97,15 +103,17 @@ def get_avatar(cls, name: t.Optional[str] = None, uuid: t.Optional[str] = None) """ Get the avatar of the specified player - Args: - name (t.Optional[str], optional): The username of the player. Defaults to None. - uuid (t.Optional[str], optional): The UUID of the player. Defaults to None. - - Raises: - InvalidArgumentError: Raised if neither UUID or username isn't passed. - - Returns: - str: The URL containing the image of the avatar. + Parameters + ---------- + name: t.Optional[str] + The username of the player. Defaults to None. + uuid: t.Optional[str] + The UUID of the player. Defaults to None. + + Returns + ------- + str + The URL containing the image of the avatar. """ if name: uuid = Converters.username_to_uuid(name) @@ -122,15 +130,17 @@ def get_head(cls, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> """ Get the head skin of the specified player - Args: - name (t.Optional[str], optional): The username of the player. Defaults to None. - uuid (t.Optional[str], optional): The UUID of the player. Defaults to None. - - Raises: - InvalidArgumentError: Raised if neither UUID or username isn't passed. - - Returns: - str: The URL containing the image of the head. + Parameters + ---------- + name: t.Optional[str] + The username of the player. Defaults to None. + uuid: t.Optional[str] + The UUID of the player. Defaults to None. + + Returns + ------- + str + The URL containing the image of the head. """ if name: uuid = Converters.username_to_uuid(name) @@ -147,15 +157,17 @@ def get_body(cls, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> """ Get the whole body's skin of the specified player - Args: - name (t.Optional[str], optional): The username of the player. Defaults to None. - uuid (t.Optional[str], optional): The UUID of the player. Defaults to None. - - Raises: - InvalidArgumentError: Raised if neither UUID or username isn't passed. - - Returns: - str: The URL containing the image of the whole body. + Parameters + ---------- + name: t.Optional[str] + The username of the player. Defaults to None. + uuid: t.Optional[str] + The UUID of the player. Defaults to None. + + Returns + ------- + str + The URL containing the image of the whole body. """ if name: uuid = Converters.username_to_uuid(name) diff --git a/hypixelio/utils/helpers.py b/hypixelio/utils/helpers.py index 59a6f58..e049592 100644 --- a/hypixelio/utils/helpers.py +++ b/hypixelio/utils/helpers.py @@ -22,7 +22,7 @@ def form_url(main_url: str, url: str, data: dict = None) -> str: Returns ------- str: - The Final URL with the Get request parameters, and the URL Route. + The Final URL with the GET request parameters, and the URL Route. """ if not data: data = {} From 4ff9af89273fde85b0d076472ffd15b38af85c3c Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 15:36:53 +0530 Subject: [PATCH 12/55] Complete documentation rewrite. --- hypixelio/lib/client.py | 180 +++++++++++++++++++--------------------- 1 file changed, 87 insertions(+), 93 deletions(-) diff --git a/hypixelio/lib/client.py b/hypixelio/lib/client.py index 2bef32e..2cb0e1b 100644 --- a/hypixelio/lib/client.py +++ b/hypixelio/lib/client.py @@ -37,13 +37,14 @@ class Client: """The client for this wrapper, that handles the requests, authentication, loading and usages of the end user.""" def __init__(self, api_key: t.Union[str, list], cache: bool = False, cache_config: caching.Caching = None) -> None: """ - The constructor for the `Client` class. - - Args: - api_key (t.Union[str, list]): The API Key generated in Hypixel using `/api new` command. - cache (bool, optional): [description]. Whether to enable caching - cache_config (caching.Caching, optional): The configuration for the saving, and reusing of the cache. - Defaults to None. + Parameters + ---------- + api_key: t.Union[str, list] + The API Key generated in Hypixel using `/api new` command. + cache: t.Optional[bool] + Whether to enable caching + cache_config: t.Optional[caching.Caching] + The configuration for the saving, and reusing of the cache. Defaults to None. """ self.url = API_PATH["HYPIXEL"] @@ -60,22 +61,20 @@ def __init__(self, api_key: t.Union[str, list], cache: bool = False, cache_confi def _fetch(self, url: str, data: dict = None) -> t.Tuple[dict, bool]: """ - Get the JSON Response from the Root Hypixel API URL, - and Also add the ability to include the GET request parameters - with the API KEY Parameter by default. - - Args: - url (str): The URL to be accessed from the Root Domain. - data (dict, optional): The GET Request's Key-Value Pair. Example: {"uuid": "abc"} is converted to - `?uuid=abc`. Defaults to None. - - Raises: - RateLimitError: Raised, When a certain user, or API Key is being ratelimited from the API. - HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. - - Returns: - t.Tuple[dict, bool]: The JSON Response from the Fetch Done to the API and the SUCCESS Value from the - Response. + Get the JSON Response from the Root Hypixel API URL, and also add the ability to include the GET request + parameters with the API KEY Parameter by default. + + Parameters + ---------- + url: str + The URL to be accessed from the Root Domain. + data: t.Optional[dict] + The GET Request's Key-Value Pair. Example: {"uuid": "abc"} is converted to `?uuid=abc`. Defaults to None. + + Returns + ------- + t.Tuple[dict, bool] + The JSON Response from the Fetch Done to the API and the SUCCESS Value from the Response. """ if not data: data = {} @@ -100,15 +99,15 @@ def get_key_info(self, api_key: t.Optional[str] = None) -> key.Key: """ Get the Info about an API Key generated in Hypixel. - Args: - api_key (t.Optional[str], optional): The API Key generated in Hypixel using `/api new` command. Defaults to - None. - - Raises: - HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. + Parameters + ---------- + api_key: t.Optional[str] + The API Key generated in Hypixel using `/api new` command. Defaults to None. - Returns: - key.Key: Key object for the API Key. + Returns + ------- + key.Key + Key object for the API Key. """ if not api_key: api_key = random.choice(self.api_key) @@ -123,11 +122,10 @@ def get_boosters(self) -> boosters.Boosters: """ Get the List of Hypixel Coin Boosters and Their Info. - Raises: - HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. - - Returns: - boosters.Boosters: The Booster Class Object, Which depicts the Booster Data Model. + Returns + ------- + boosters.Boosters + The Booster class object which depicts the booster data model. """ json, success = self._fetch(self.url["boosters"]) @@ -139,17 +137,17 @@ def get_player(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) """ Get the Info about a Hypixel Player using either his Username or UUID. - Args: - name (t.Optional[str], optional): The Optional string value for the Username. Defaults to None. - uuid (t.Optional[str], optional): The Optional string Value to the UUID. Defaults to None. - - Raises: - InvalidArgumentError: Returned when either UUID or Username are not provided. - HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. - PlayerNotFoundError: Raised, When a certain Player is not found. - - Returns: - player.Player: The Player Class Object, Which depicts the Player Data Model + Parameters + ---------- + name: t.Optional[str] + The Optional string value for the Username. Defaults to None. + uuid: t.Optional[str] + The Optional string Value to the UUID. Defaults to None. + + Returns + ------- + player.Player + The Player Class Object, Which depicts the Player Data Model """ if name: json, success = self._fetch(self.url["player"], {"name": name}) @@ -170,16 +168,15 @@ def get_friends(self, uuid: t.Optional[str] = None) -> friends.Friends: """ Get the List of Friends of a Hypixel Player and their Info. - Args: - uuid (t.Optional[str], optional): The UUID of a Certain Hypixel Player. Defaults to None. - - Raises: - InvalidArgumentError: Returned when the UUID is not provided. - HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. + Parameters + ---------- + uuid: t.Optional[str] + The UUID of a Certain Hypixel Player. Defaults to None. - Returns: - friends.Friends: Returns the Friend Data Model, Which has the List of Friends, Each with a List of - Attributes. + Returns + ------- + friends.Friends + Returns the Friend Data Model, Which has the List of Friends, each with a list of attributes. """ if uuid: json, success = self._fetch(self.url["friends"], {"uuid": uuid}) @@ -194,12 +191,10 @@ def get_watchdog_info(self) -> watchdog.Watchdog: """ Get the List of Stats About the Watchdog for the last few days. - Raises: - HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. - - Returns: - watchdog.Watchdog: The Watchdog data model with certain important attributes for you to get data about the - things by watchdog. + Returns + ------- + watchdog.Watchdog + The Watchdog data model with certain important attributes for you to get data about the things by watchdog. """ json, success = self._fetch(self.url["watchdog"]) @@ -211,17 +206,17 @@ def get_guild(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) """ Get the Info about a Hypixel Guild, Either using Name or UUID. - Args: - name (t.Optional[str], optional): The Name of the Guild. Defaults to None. - uuid (t.Optional[str], optional): The ID Of the guild. Defaults to None. - - Raises: - InvalidArgumentError: Returned when the UUID is not provided. - HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. - GuildNotFoundError: Raised, When a certain Guild is not found. - - Returns: - guild.Guild: The Guild Object with certain Attributes for you to access, and use it. + Parameters + ---------- + name: t.Optional[str] + The Name of the Guild. Defaults to None. + uuid: t.Optional[str] + The ID Of the guild. Defaults to None. + + Returns + ------- + guild.Guild + The Guild Object with certain Attributes for you to access, and use it. """ if uuid: json, success = self._fetch(self.url["guild"], {"id": uuid}) @@ -241,11 +236,10 @@ def get_games_info(self) -> games.Games: """ Get the List of Hypixel Games and Their Info. - Raises: - HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. - - Returns: - games.Games: The Games Data model, Containing the information, and attributes for all the games. + Returns + ------- + games.Games + The Games Data model, Containing the information, and attributes for all the games. """ json, success = self._fetch(self.url["game_info"]) @@ -257,11 +251,10 @@ def get_leaderboards(self) -> leaderboard.Leaderboard: """ Get the Leaderboard for all the games, along with the data in it. - Raises: - HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. - - Returns: - leaderboard.Leaderboard: The Leaderboard data model, containing all the ranking for the games in Hypixel. + Returns + ------- + leaderboard.Leaderboard + The Leaderboard data model, containing all the ranking for the games in Hypixel. """ json, success = self._fetch(self.url["leaderboards"]) @@ -275,16 +268,17 @@ def find_guild( """ Finds the Guild By the Guild's Name or using a Player's UUID - Args: - guild_name (t.Optional[str], optional): The name of the Guild. Defaults to None. - player_uuid (t.Optional[str], optional): The UUID of the Player to find his guild. Defaults to None. - - Raises: - InvalidArgumentError: Returned when the named argument is not provided. - HypixelAPIError: Raised when the Hypixel API is facing some issues, or errors. - - Returns: - find_guild.FindGuild: The ID of the guild being find. + Parameters + ---------- + guild_name: t.Optional[str] + The name of the Guild. Defaults to None. + player_uuid: t.Optional[str] + The UUID of the Player to find his guild. Defaults to None. + + Returns + ------- + find_guild.FindGuild + The ID of the guild being find. """ if guild_name: json, success = self._fetch(self.url["find_guild"], {"byName": guild_name}) From 824e3cf32989a1d74e1f8a315570dee908ace010 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 15:58:13 +0530 Subject: [PATCH 13/55] Change the watchdog and booster model. Set the API Key as header to protect it. --- hypixelio/lib/client.py | 7 +++---- hypixelio/models/boosters/boosters.py | 2 ++ hypixelio/models/watchdog.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hypixelio/lib/client.py b/hypixelio/lib/client.py index 2cb0e1b..d634322 100644 --- a/hypixelio/lib/client.py +++ b/hypixelio/lib/client.py @@ -79,12 +79,11 @@ def _fetch(self, url: str, data: dict = None) -> t.Tuple[dict, bool]: if not data: data = {} - if "key" not in data: - data["key"] = random.choice(self.api_key) + headers = {"API-Key": random.choice(self.api_key)} url = form_url(HYPIXEL_API, url, data) - with requests.get(url, timeout=TIMEOUT) as response: + with requests.get(url, timeout=TIMEOUT, headers=headers) as response: if response.status_code == 429: raise RateLimitError("Out of Requests!") @@ -131,7 +130,7 @@ def get_boosters(self) -> boosters.Boosters: if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") - return boosters.Boosters(json["boosters"]) + return boosters.Boosters(json["boosters"], json) def get_player(self, name: t.Optional[str] = None, uuid: t.Optional[str] = None) -> player.Player: """ diff --git a/hypixelio/models/boosters/boosters.py b/hypixelio/models/boosters/boosters.py index 60d9db8..151c031 100644 --- a/hypixelio/models/boosters/boosters.py +++ b/hypixelio/models/boosters/boosters.py @@ -10,6 +10,7 @@ class Boosters: def __init__( self, boosters: list, + json: dict ) -> None: """ Parameters @@ -18,6 +19,7 @@ def __init__( The list of the Coin Boosters in the Hypixel server. """ self.BOOSTERS = [BoosterInfo(booster) for booster in boosters] + self.STATE = json["boosterState"] def __len__(self) -> int: return len(self.BOOSTERS) diff --git a/hypixelio/models/watchdog.py b/hypixelio/models/watchdog.py index 6bfadda..91cf30a 100644 --- a/hypixelio/models/watchdog.py +++ b/hypixelio/models/watchdog.py @@ -20,14 +20,14 @@ def __init__( self.STAFF_ROLLING_DAILY = data["staff_rollingDaily"] self.TOTAL_BANS = data["watchdog_total"] - self.WATCHDOG_ROLLING_DAILY = data["watchdog_rollingDaily"] + self.ROLLING_DAILY = data["watchdog_rollingDaily"] self.STAFF_TOTAL_BANS = data["staff_total"] def __str__(self) -> str: return self.LAST_MINUTE_BAN def __repr__(self) -> str: - return f'<{self.__class__.__name__} last_minute_ban={self.LAST_MINUTE_BAN} rolling_daily={self.WATCHDOG_ROLLING_DAILY}>' + return f'<{self.__class__.__name__} last_minute_ban={self.LAST_MINUTE_BAN} rolling_daily={self.ROLLING_DAILY}>' def __hash__(self) -> int: return hash(self.LAST_MINUTE_BAN) From 7357da532ddf1150d2d23a0695d2dfeb2d63a460 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 16:00:37 +0530 Subject: [PATCH 14/55] Fix example code. --- examples/get-watchdog-stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/get-watchdog-stats.py b/examples/get-watchdog-stats.py index ccce085..ff57752 100644 --- a/examples/get-watchdog-stats.py +++ b/examples/get-watchdog-stats.py @@ -12,7 +12,7 @@ # Extract the Data last_minute_ban = watchdog.LAST_MINUTE_BAN total_bans = watchdog.TOTAL_BANS -rolling_daily = watchdog.WATCHDOG_ROLLING_DAILY +rolling_daily = watchdog.ROLLING_DAILY # Display the data print( From e5c8a71231fb4eed8b87b5fdb391bd155d6000ed Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 17:06:15 +0530 Subject: [PATCH 15/55] Work on new endpoints, add descriptive models for them. Add new endpoints to the list. --- hypixelio/endpoints.py | 4 +- hypixelio/lib/client.py | 67 +++++++++++++++++++ hypixelio/models/player_status.py | 22 ++++++ hypixelio/models/recent_games/__init__.py | 1 + .../models/recent_games/recent_game_info.py | 22 ++++++ hypixelio/models/recent_games/recent_games.py | 39 +++++++++++ 6 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 hypixelio/models/player_status.py create mode 100644 hypixelio/models/recent_games/__init__.py create mode 100644 hypixelio/models/recent_games/recent_game_info.py create mode 100644 hypixelio/models/recent_games/recent_games.py diff --git a/hypixelio/endpoints.py b/hypixelio/endpoints.py index 6ea661a..95758c8 100644 --- a/hypixelio/endpoints.py +++ b/hypixelio/endpoints.py @@ -10,7 +10,9 @@ "guild": "/guild", "game_info": "/gameCounts", "leaderboards": "/leaderboards", - "find_guild": "/findGuild" + "find_guild": "/findGuild", + "status": "/status", + "recent_games": "/recentgames" }, "MOJANG": { "username_to_uuid": "/users/profiles/minecraft/{}", diff --git a/hypixelio/lib/client.py b/hypixelio/lib/client.py index d634322..a90b2b5 100644 --- a/hypixelio/lib/client.py +++ b/hypixelio/lib/client.py @@ -12,6 +12,7 @@ PlayerNotFoundError, RateLimitError, ) +from hypixelio.lib.converters import Converters from hypixelio.models import ( boosters, caching, @@ -22,6 +23,8 @@ key, leaderboard, player, + player_status, + recent_games, watchdog ) from hypixelio.utils.constants import ( @@ -289,3 +292,67 @@ def find_guild( if not success: raise HypixelAPIError("The Key given is invalid, or something else has problem.") return find_guild.FindGuild(json) + + def get_player_status( + self, name: t.Optional[str] = None, uuid: t.Optional[str] = None + ) -> player_status.PlayerStatus: + """ + Get the Status info about a Hypixel Player using either his Username or UUID. + + Parameters + ---------- + name: t.Optional[str] + The Optional string value for the Username. Defaults to None. + uuid: t.Optional[str] + The Optional string Value to the UUID. Defaults to None. + + Returns + ------- + player_status.PlayerStatus + The Player Status Object, which depicts the Player's status + """ + if name: + uuid = Converters.username_to_uuid(name) + json, success = self._fetch(self.url["status"], {"uuid": uuid}) + elif uuid: + json, success = self._fetch(self.url["status"], {"uuid": uuid}) + else: + raise InvalidArgumentError("Please provide a named argument of the player's username or player's UUID.") + + if not success: + raise HypixelAPIError( + f"The Key given is invalid, or something else has problem. Reason given: {json['cause']}") + + return player_status.PlayerStatus(json) + + def get_player_recent_games( + self, name: t.Optional[str] = None, uuid: t.Optional[str] = None + ) -> recent_games.RecentGames: + """ + Get the recent games played by a Hypixel Player using either his Username or UUID. + + Parameters + ---------- + name: t.Optional[str] + The Optional string value for the Username. Defaults to None. + uuid: t.Optional[str] + The Optional string Value to the UUID. Defaults to None. + + Returns + ------- + recent_games.RecentGames + The recent games model for the respective player specified. + """ + if name: + uuid = Converters.username_to_uuid(name) + json, success = self._fetch(self.url["recent_games"], {"uuid": uuid}) + elif uuid: + json, success = self._fetch(self.url["recent_games"], {"uuid": uuid}) + else: + raise InvalidArgumentError("Please provide a named argument of the player's username or player's UUID.") + + if not success: + raise HypixelAPIError( + f"The Key given is invalid, or something else has problem. Reason given: {json['cause']}") + + return recent_games.RecentGames(json) diff --git a/hypixelio/models/player_status.py b/hypixelio/models/player_status.py new file mode 100644 index 0000000..7ca0eb6 --- /dev/null +++ b/hypixelio/models/player_status.py @@ -0,0 +1,22 @@ +class PlayerStatus: + def __init__(self, data: dict) -> None: + """ + Parameters + ---------- + data: dict + The JSON data received from the Hypixel API. + """ + self.UUID = data["uuid"] + self.SESSION_INFO = data["session"] + + def __str__(self) -> str: + return self.UUID + + def __repr__(self) -> str: + return f'<{self.__class__.__name__} uuid="{self.UUID}" online="{self.SESSION_INFO["online"]}">' + + def __hash__(self) -> int: + return hash(self.UUID) + + def __eq__(self, other: "PlayerStatus") -> bool: + return self.UUID == other.UUID diff --git a/hypixelio/models/recent_games/__init__.py b/hypixelio/models/recent_games/__init__.py new file mode 100644 index 0000000..2d86988 --- /dev/null +++ b/hypixelio/models/recent_games/__init__.py @@ -0,0 +1 @@ +from .recent_games import RecentGames diff --git a/hypixelio/models/recent_games/recent_game_info.py b/hypixelio/models/recent_games/recent_game_info.py new file mode 100644 index 0000000..3761c83 --- /dev/null +++ b/hypixelio/models/recent_games/recent_game_info.py @@ -0,0 +1,22 @@ +class RecentGameInfo: + def __init__(self, game: dict) -> None: + """ + Parameters + ---------- + game: dict + The game's JSON data received from the Hypixel API. + """ + self.DATE = game["date"] + self.END_DATETIME = game["ended"] + self.GAME_TYPE = game["gameType"] + self.MODE = game.get("mode") + self.MAP = game["map"] + + def __hash__(self) -> int: + return hash((self.DATE, self.MAP)) + + def __str__(self) -> str: + return self.GAME_TYPE + + def __repr__(self) -> str: + return f'<{self.__class__.__name__} game_type="{self.GAME_TYPE}" mode="{self.MODE}" map="{self.MAP}">' diff --git a/hypixelio/models/recent_games/recent_games.py b/hypixelio/models/recent_games/recent_games.py new file mode 100644 index 0000000..ff5eba1 --- /dev/null +++ b/hypixelio/models/recent_games/recent_games.py @@ -0,0 +1,39 @@ +import typing as t + +from .recent_game_info import RecentGameInfo + + +class RecentGames: + def __init__(self, data: dict) -> None: + """ + Parameters + ---------- + data: dict + The JSON data received from the Hypixel API. + """ + self.UUID = data["uuid"] + self.GAMES = [RecentGameInfo(game) for game in data["games"]] + + def __len__(self) -> int: + return len(self.GAMES) + + def __getitem__(self, key: int) -> RecentGameInfo: + return self.GAMES[key] + + def __setitem__(self, key: int, value: RecentGameInfo) -> None: + self.GAMES[key] = value + + def __iter__(self) -> t.Iterator: + return iter(self.GAMES) + + def __str__(self) -> str: + return self.UUID + + def __repr__(self) -> str: + return f'<{self.__class__.__name__} uuid="{self.UUID}">' + + def __hash__(self) -> int: + return hash(self.UUID) + + def __eq__(self, other: "RecentGames") -> bool: + return self.UUID == other.UUID From 3704c1742e16d4b33891d43750ffc6fdd40f0b16 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Fri, 5 Mar 2021 17:34:18 +0530 Subject: [PATCH 16/55] Add more endpoints. --- hypixelio/endpoints.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hypixelio/endpoints.py b/hypixelio/endpoints.py index 95758c8..ccc9e93 100644 --- a/hypixelio/endpoints.py +++ b/hypixelio/endpoints.py @@ -12,7 +12,11 @@ "leaderboards": "/leaderboards", "find_guild": "/findGuild", "status": "/status", - "recent_games": "/recentgames" + "recent_games": "/recentgames", + "skyblock_auctions": "/skyblock/auction", + "skyblock_active_auctions": "/skyblock/auctions", + "skyblock_bazaar": "/skyblock/bazaar", + "skyblock_profile": "/skyblock/profile" }, "MOJANG": { "username_to_uuid": "/users/profiles/minecraft/{}", From 0caa5eb39346d0edb5cf70a1a3f14af82b571f00 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 15:41:02 +0530 Subject: [PATCH 17/55] Continue working on the Skyblock profile model. --- hypixelio/models/skyblock/__init__.py | 0 hypixelio/models/skyblock/profile/__init__.py | 0 hypixelio/models/skyblock/profile/profile.py | 40 +++++++++++++++++++ .../models/skyblock/profile/profile_member.py | 15 +++++++ 4 files changed, 55 insertions(+) create mode 100644 hypixelio/models/skyblock/__init__.py create mode 100644 hypixelio/models/skyblock/profile/__init__.py create mode 100644 hypixelio/models/skyblock/profile/profile.py create mode 100644 hypixelio/models/skyblock/profile/profile_member.py diff --git a/hypixelio/models/skyblock/__init__.py b/hypixelio/models/skyblock/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hypixelio/models/skyblock/profile/__init__.py b/hypixelio/models/skyblock/profile/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hypixelio/models/skyblock/profile/profile.py b/hypixelio/models/skyblock/profile/profile.py new file mode 100644 index 0000000..12fa04e --- /dev/null +++ b/hypixelio/models/skyblock/profile/profile.py @@ -0,0 +1,40 @@ +import typing as t + +from .profile_member import SkyblockProfileMember + + +class SkyblockProfile: + def __init__(self, data: dict) -> None: + """ + Parameters + ---------- + data: dict + The JSON data received from the Hypixel API. + """ + self.PROFILE_ID = data["profile"]["profile_id"] + self.MEMBERS = [SkyblockProfileMember(member) for member in data["members"]] + self.COMMUNITY_UPGRADES = data["community_upgrades"] + + def __str__(self) -> str: + return self.PROFILE_ID + + def __repr__(self) -> str: + return f'<{self.__class__.__name__} id="{self.PROFILE_ID}" member_count="{len(self.MEMBERS)}">' + + def __hash__(self) -> int: + return hash(self.PROFILE_ID) + + def __eq__(self, other: "SkyblockProfile") -> bool: + return self.PROFILE_ID == other.PROFILE_ID + + def __len__(self) -> int: + return len(self.MEMBERS) + + def __getitem__(self, key: int) -> SkyblockProfileMember: + return self.MEMBERS[key] + + def __setitem__(self, key: int, value: SkyblockProfileMember) -> None: + self.MEMBERS[key] = value + + def __iter__(self) -> t.Iterator: + return iter(self.MEMBERS) diff --git a/hypixelio/models/skyblock/profile/profile_member.py b/hypixelio/models/skyblock/profile/profile_member.py new file mode 100644 index 0000000..0f1ea65 --- /dev/null +++ b/hypixelio/models/skyblock/profile/profile_member.py @@ -0,0 +1,15 @@ +class SkyblockProfileMember: + def __init__(self, member_data: dict) -> None: + """ + Parameters + ---------- + data: dict + The JSON data received from the Hypixel API. + """ + self.COIN_PURSE = member_data["coin_purse"] + self.DEATH_COUNT = member_data["death_count"] + + self.STATS = member_data["stats"] + self.OBJECTIVES = member_data["objectives"] + + self.CRAFTED_GENERATORS = member_data["crafted_generators"] From a6327427c458bafe81c79d321d6694e38cf54b00 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 15:51:20 +0530 Subject: [PATCH 18/55] Complete the syblock profile models. --- .../models/skyblock/profile/profile_member.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hypixelio/models/skyblock/profile/profile_member.py b/hypixelio/models/skyblock/profile/profile_member.py index 0f1ea65..3c4c53a 100644 --- a/hypixelio/models/skyblock/profile/profile_member.py +++ b/hypixelio/models/skyblock/profile/profile_member.py @@ -8,8 +8,32 @@ def __init__(self, member_data: dict) -> None: """ self.COIN_PURSE = member_data["coin_purse"] self.DEATH_COUNT = member_data["death_count"] + self.FAIRY_SOULS_COLLECTED = member_data["fairy_souls_collected"] + self.FISHING_TREASURE_COUNT = member_data["fishing_treasure_caught"] self.STATS = member_data["stats"] self.OBJECTIVES = member_data["objectives"] self.CRAFTED_GENERATORS = member_data["crafted_generators"] + self.VISITED_ZONES = member_data["visited_zones"] + self.ACHIEVEMENT_SPAWNED_ISLAND_TYPES = member_data["achievement_spawned_island_types"] + + self.SLAYER_QUEST = member_data["slayer_quest"] + self.SLAYER_BOSSES = member_data["slayer_bosses"] + + self.PETS = member_data["pets"] + self.GRIFFIN = member_data["griffin"] + + self.UNLOCKED_COLLECTION_TIERS = member_data["unlocked_coll_tiers"] + + self.SKILLS = { + "alchemy": member_data["experience_skill_alchemy"], + "farming": member_data["experience_skill_farming"], + "taming": member_data["experience_skill_taming"], + "enchanting": member_data["experience_skill_enchanting"], + "fishing": member_data["experience_skill_fishing"], + "foraging": member_data["experience_skill_foraging"], + "carpentry": member_data["experience_skill_carpentry"] + } + + self.COLLECTION = member_data["collection"] From 0a47bddb4cc9b3f62bb9a215c2a035bb9bae060b Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 16:58:25 +0530 Subject: [PATCH 19/55] Debug and get skyblock endpoint working. --- hypixelio/lib/client.py | 21 +++++++++++ hypixelio/models/skyblock/__init__.py | 1 + hypixelio/models/skyblock/profile/__init__.py | 1 + hypixelio/models/skyblock/profile/profile.py | 10 ++++-- .../models/skyblock/profile/profile_member.py | 35 ++++++++++--------- 5 files changed, 49 insertions(+), 19 deletions(-) diff --git a/hypixelio/lib/client.py b/hypixelio/lib/client.py index a90b2b5..bb90574 100644 --- a/hypixelio/lib/client.py +++ b/hypixelio/lib/client.py @@ -25,6 +25,7 @@ player, player_status, recent_games, + skyblock, watchdog ) from hypixelio.utils.constants import ( @@ -356,3 +357,23 @@ def get_player_recent_games( f"The Key given is invalid, or something else has problem. Reason given: {json['cause']}") return recent_games.RecentGames(json) + + def get_skyblock_profile( + self, name: t.Optional[str] = None, uuid: t.Optional[str] = None + ) -> skyblock.SkyblockProfile: + if name: + uuid = Converters.username_to_uuid(name) + json, success = self._fetch(self.url["skyblock_profile"], {"profile": uuid}) + elif uuid: + json, success = self._fetch(self.url["skyblock_profile"], {"profile": uuid}) + else: + raise InvalidArgumentError("Please provide a named argument of the player's username or player's UUID.") + + if not success: + raise HypixelAPIError( + f"The Key given is invalid, or something else has problem. Reason given: {json['cause']}") + + if not json["profile"]: + raise PlayerNotFoundError("The skyblock player being searched does not exist!", uuid) + return skyblock.SkyblockProfile(json) + # return json diff --git a/hypixelio/models/skyblock/__init__.py b/hypixelio/models/skyblock/__init__.py index e69de29..5a8f131 100644 --- a/hypixelio/models/skyblock/__init__.py +++ b/hypixelio/models/skyblock/__init__.py @@ -0,0 +1 @@ +from .profile import SkyblockProfile diff --git a/hypixelio/models/skyblock/profile/__init__.py b/hypixelio/models/skyblock/profile/__init__.py index e69de29..5a8f131 100644 --- a/hypixelio/models/skyblock/profile/__init__.py +++ b/hypixelio/models/skyblock/profile/__init__.py @@ -0,0 +1 @@ +from .profile import SkyblockProfile diff --git a/hypixelio/models/skyblock/profile/profile.py b/hypixelio/models/skyblock/profile/profile.py index 12fa04e..1dad9ae 100644 --- a/hypixelio/models/skyblock/profile/profile.py +++ b/hypixelio/models/skyblock/profile/profile.py @@ -11,9 +11,13 @@ def __init__(self, data: dict) -> None: data: dict The JSON data received from the Hypixel API. """ - self.PROFILE_ID = data["profile"]["profile_id"] - self.MEMBERS = [SkyblockProfileMember(member) for member in data["members"]] - self.COMMUNITY_UPGRADES = data["community_upgrades"] + self.__PROFILE_JSON = data["profile"] + + self.PROFILE_ID = self.__PROFILE_JSON["profile_id"] + self.MEMBERS = [ + SkyblockProfileMember(self.__PROFILE_JSON["members"][member]) for member in self.__PROFILE_JSON["members"] + ] + self.COMMUNITY_UPGRADES = self.__PROFILE_JSON["community_upgrades"] def __str__(self) -> str: return self.PROFILE_ID diff --git a/hypixelio/models/skyblock/profile/profile_member.py b/hypixelio/models/skyblock/profile/profile_member.py index 3c4c53a..e6823b7 100644 --- a/hypixelio/models/skyblock/profile/profile_member.py +++ b/hypixelio/models/skyblock/profile/profile_member.py @@ -8,32 +8,35 @@ def __init__(self, member_data: dict) -> None: """ self.COIN_PURSE = member_data["coin_purse"] self.DEATH_COUNT = member_data["death_count"] - self.FAIRY_SOULS_COLLECTED = member_data["fairy_souls_collected"] - self.FISHING_TREASURE_COUNT = member_data["fishing_treasure_caught"] + self.FAIRY_SOULS_COLLECTED = member_data.get("fairy_souls_collected") + self.FISHING_TREASURE_COUNT = member_data.get("fishing_treasure_caught") self.STATS = member_data["stats"] self.OBJECTIVES = member_data["objectives"] - self.CRAFTED_GENERATORS = member_data["crafted_generators"] - self.VISITED_ZONES = member_data["visited_zones"] - self.ACHIEVEMENT_SPAWNED_ISLAND_TYPES = member_data["achievement_spawned_island_types"] + self.CRAFTED_GENERATORS = member_data.get("crafted_generators") + self.VISITED_ZONES = member_data.get("visited_zones") + self.ACHIEVEMENT_SPAWNED_ISLAND_TYPES = member_data.get("achievement_spawned_island_types") - self.SLAYER_QUEST = member_data["slayer_quest"] - self.SLAYER_BOSSES = member_data["slayer_bosses"] + self.SLAYER_QUEST = member_data.get("slayer_quest") + self.SLAYER_BOSSES = member_data.get("slayer_bosses") self.PETS = member_data["pets"] self.GRIFFIN = member_data["griffin"] - self.UNLOCKED_COLLECTION_TIERS = member_data["unlocked_coll_tiers"] + self.UNLOCKED_COLLECTION_TIERS = member_data.get("unlocked_coll_tiers") self.SKILLS = { - "alchemy": member_data["experience_skill_alchemy"], - "farming": member_data["experience_skill_farming"], - "taming": member_data["experience_skill_taming"], - "enchanting": member_data["experience_skill_enchanting"], - "fishing": member_data["experience_skill_fishing"], - "foraging": member_data["experience_skill_foraging"], - "carpentry": member_data["experience_skill_carpentry"] + "alchemy": member_data.get("experience_skill_alchemy"), + "farming": member_data.get("experience_skill_farming"), + "taming": member_data.get("experience_skill_taming"), + "enchanting": member_data.get("experience_skill_enchanting"), + "fishing": member_data.get("experience_skill_fishing"), + "foraging": member_data.get("experience_skill_foraging"), + "carpentry": member_data.get("experience_skill_carpentry"), + "runecrafting": member_data.get("experience_skill_runecrafting"), + "combat": member_data.get("experience_skill_combat"), + "mining": member_data.get("experience_skill_mining") } - self.COLLECTION = member_data["collection"] + self.COLLECTION = member_data.get("collection") From c732aba888c47bd179967424df075941d19dcc36 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 17:01:23 +0530 Subject: [PATCH 20/55] Forgot to remove a DEBUG statement. --- hypixelio/lib/client.py | 1 - 1 file changed, 1 deletion(-) diff --git a/hypixelio/lib/client.py b/hypixelio/lib/client.py index bb90574..3e9b041 100644 --- a/hypixelio/lib/client.py +++ b/hypixelio/lib/client.py @@ -376,4 +376,3 @@ def get_skyblock_profile( if not json["profile"]: raise PlayerNotFoundError("The skyblock player being searched does not exist!", uuid) return skyblock.SkyblockProfile(json) - # return json From 47d2afcbd42a629f853446c97ef95cda09d9d153 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 17:06:39 +0530 Subject: [PATCH 21/55] Refactor the model files. --- hypixelio/models/boosters/booster_info.py | 8 +------- hypixelio/models/boosters/boosters.py | 8 +------- hypixelio/models/caching/backend.py | 2 +- hypixelio/models/find_guild.py | 8 +------- hypixelio/models/friends/friend_data.py | 8 +------- hypixelio/models/friends/friends.py | 7 +------ hypixelio/models/games/game_count.py | 8 +------- hypixelio/models/games/games.py | 6 +----- hypixelio/models/guild.py | 8 +------- hypixelio/models/key.py | 8 +------- hypixelio/models/leaderboard/leaderboard.py | 5 +---- hypixelio/models/leaderboard/leaderboard_data.py | 5 +---- hypixelio/models/player.py | 8 +------- hypixelio/models/watchdog.py | 12 ++---------- 14 files changed, 15 insertions(+), 86 deletions(-) diff --git a/hypixelio/models/boosters/booster_info.py b/hypixelio/models/boosters/booster_info.py index 538e16a..e207829 100644 --- a/hypixelio/models/boosters/booster_info.py +++ b/hypixelio/models/boosters/booster_info.py @@ -1,12 +1,6 @@ -"""This module is dedicated to definition of the Player class.""" - - class BoosterInfo: """The Hypixel API Booster's Info Model.""" - def __init__( - self, - info: dict - ) -> None: + def __init__(self, info: dict) -> None: """ Parameters ---------- diff --git a/hypixelio/models/boosters/boosters.py b/hypixelio/models/boosters/boosters.py index 151c031..72cfdf8 100644 --- a/hypixelio/models/boosters/boosters.py +++ b/hypixelio/models/boosters/boosters.py @@ -1,5 +1,3 @@ -"""This module is dedicated to definition of the Boosters class.""" - import typing as t from .booster_info import BoosterInfo @@ -7,11 +5,7 @@ class Boosters: """The the Custom Hypixel API Boosters Model.""" - def __init__( - self, - boosters: list, - json: dict - ) -> None: + def __init__(self, boosters: list, json: dict) -> None: """ Parameters ---------- diff --git a/hypixelio/models/caching/backend.py b/hypixelio/models/caching/backend.py index aa0eb08..e8e7609 100644 --- a/hypixelio/models/caching/backend.py +++ b/hypixelio/models/caching/backend.py @@ -3,7 +3,7 @@ @dataclass class CacheBackend: - """The Backend Adapters available for the caching.""" + """The Backend adapters available for the caching.""" sqlite: str = "sqlite" mongodb: str = "mongodb" redis: str = "redis" diff --git a/hypixelio/models/find_guild.py b/hypixelio/models/find_guild.py index 78f91dc..407491c 100644 --- a/hypixelio/models/find_guild.py +++ b/hypixelio/models/find_guild.py @@ -1,12 +1,6 @@ -"""This module is dedicated to definition of the Find Guild class.""" - - class FindGuild: """This is the Custom Hypixel model for looking up guilds.""" - def __init__( - self, - data: dict - ) -> None: + def __init__(self, data: dict) -> None: """ Parameters ---------- diff --git a/hypixelio/models/friends/friend_data.py b/hypixelio/models/friends/friend_data.py index 48ff95f..e361570 100644 --- a/hypixelio/models/friends/friend_data.py +++ b/hypixelio/models/friends/friend_data.py @@ -1,14 +1,8 @@ -"""This module is dedicated to definition of the Friend's Data class.""" - - class FriendData: """ This is the Custom Hypixel API Friend's Data Model. """ - def __init__( - self, - friend: dict, - ) -> None: + def __init__(self, friend: dict) -> None: """ Parameters ---------- diff --git a/hypixelio/models/friends/friends.py b/hypixelio/models/friends/friends.py index 65dad4d..4435899 100644 --- a/hypixelio/models/friends/friends.py +++ b/hypixelio/models/friends/friends.py @@ -1,5 +1,3 @@ -"""This module is dedicated to definition of the Friends class.""" - import typing as t from .friend_data import FriendData @@ -7,10 +5,7 @@ class Friends: """The the Custom Hypixel API Friends Model.""" - def __init__( - self, - friends: list - ) -> None: + def __init__(self, friends: list) -> None: """ Parameters ---------- diff --git a/hypixelio/models/games/game_count.py b/hypixelio/models/games/game_count.py index cf3c631..d305166 100644 --- a/hypixelio/models/games/game_count.py +++ b/hypixelio/models/games/game_count.py @@ -1,14 +1,8 @@ -"""This module is dedicated to definition of the Game Mode Count class.""" - - class GameCount: """ This is the definition of the Custom Hypixel API Game Mode Count Model. """ - def __init__( - self, - game: dict - ) -> None: + def __init__(self, game: dict) -> None: """ Parameters ---------- diff --git a/hypixelio/models/games/games.py b/hypixelio/models/games/games.py index b8ce31e..1a0a3d3 100644 --- a/hypixelio/models/games/games.py +++ b/hypixelio/models/games/games.py @@ -7,11 +7,7 @@ class Games: """ This is the definition of the Custom Hypixel Game count Model. """ - def __init__( - self, - games: dict, - player_count: int, - ) -> None: + def __init__(self, games: dict, player_count: int) -> None: """ Parameters ---------- diff --git a/hypixelio/models/guild.py b/hypixelio/models/guild.py index dd9676d..4afe8d7 100644 --- a/hypixelio/models/guild.py +++ b/hypixelio/models/guild.py @@ -1,12 +1,6 @@ -"""This module is dedicated to definition of the Guild class.""" - - class Guild: """The the Custom Hypixel Guild Model.""" - def __init__( - self, - data: dict - ) -> None: + def __init__(self, data: dict) -> None: """ Parameters ---------- diff --git a/hypixelio/models/key.py b/hypixelio/models/key.py index f5b5d2c..c618cb4 100644 --- a/hypixelio/models/key.py +++ b/hypixelio/models/key.py @@ -1,12 +1,6 @@ -"""This module is dedicated to definition of the Key class.""" - - class Key: """This is the Custom Hypixel API Key Model.""" - def __init__( - self, - data: dict - ) -> None: + def __init__(self, data: dict) -> None: """ Parameters ---------- diff --git a/hypixelio/models/leaderboard/leaderboard.py b/hypixelio/models/leaderboard/leaderboard.py index a52ffe3..3af7739 100644 --- a/hypixelio/models/leaderboard/leaderboard.py +++ b/hypixelio/models/leaderboard/leaderboard.py @@ -5,10 +5,7 @@ class Leaderboard: """This is the definition of the Custom Hypixel API Leaderboard Model.""" - def __init__( - self, - board: dict, - ) -> None: + def __init__(self, board: dict) -> None: """ Parameters ---------- diff --git a/hypixelio/models/leaderboard/leaderboard_data.py b/hypixelio/models/leaderboard/leaderboard_data.py index c21fa9a..1147888 100644 --- a/hypixelio/models/leaderboard/leaderboard_data.py +++ b/hypixelio/models/leaderboard/leaderboard_data.py @@ -3,10 +3,7 @@ class LeaderboardData: """This is the Custom Hypixel API Leaderboard Data Model.""" - def __init__( - self, - data: dict, - ) -> None: + def __init__(self, data: dict) -> None: """ Parameters ---------- diff --git a/hypixelio/models/player.py b/hypixelio/models/player.py index c02dda9..841f2c4 100644 --- a/hypixelio/models/player.py +++ b/hypixelio/models/player.py @@ -1,12 +1,6 @@ -"""This module is dedicated to definition of the Player class.""" - - class Player: """The the Custom Hypixel Player Model.""" - def __init__( - self, - data: dict - ) -> None: + def __init__(self, data: dict) -> None: """ Parameters ---------- diff --git a/hypixelio/models/watchdog.py b/hypixelio/models/watchdog.py index 91cf30a..123f7b2 100644 --- a/hypixelio/models/watchdog.py +++ b/hypixelio/models/watchdog.py @@ -1,14 +1,6 @@ -"""This module is dedicated to definition of the Key class.""" - - class Watchdog: - """ - This is the definition of the Custom Hypixel API Key Model. - """ - def __init__( - self, - data: dict - ) -> None: + """This is the definition of the Custom Hypixel API Key Model.""" + def __init__(self, data: dict) -> None: """ Parameters ---------- From aa9c81ebdca9918c3ffb121364071cda7b002b85 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 17:16:53 +0530 Subject: [PATCH 22/55] Configure sphinx docs. --- Pipfile | 1 + Pipfile.lock | 24 +++++++++++++++++++++++- docs/source/conf.py | 22 +++++++++++++++++++--- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index f9b21f2..62c0234 100644 --- a/Pipfile +++ b/Pipfile @@ -12,6 +12,7 @@ flake8-import-order = "~=0.18.1" pre-commit = "~=2.8.2" pytest-benchmark = "*" bandit = "*" +insegel = "*" [packages] hypixelio = {editable = true, path = "."} diff --git a/Pipfile.lock b/Pipfile.lock index 083d566..2604fec 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "3d6dafeab318cdc7aa7209bbf5ed20b0f2b9ed4aa495762c1e00e62290519d7f" + "sha256": "871b09bebb46586e91b3808246c99ce2e2aab9f1680d2ba8a6b5f4f832b69904" }, "pipfile-spec": 6, "requires": {}, @@ -105,6 +105,14 @@ "markers": "python_full_version >= '3.6.1'", "version": "==3.2.0" }, + "datarum": { + "hashes": [ + "sha256:4c4f1aca4da9d38126b91d3488be950b29eced61757b83a30c06587d38ba4566", + "sha256:61f3c7db876e756794c0bff5b32dea1bf1734292224be2c41792a8aa943b3d5a" + ], + "markers": "python_version >= '3'", + "version": "==0.3.0" + }, "distlib": { "hashes": [ "sha256:8c09de2c67b3e7deef7184574fc060ab8a793e7adbb183d942c389c8b13c52fb", @@ -182,6 +190,14 @@ ], "version": "==1.1.1" }, + "insegel": { + "hashes": [ + "sha256:9a8218d042d34a05e3a7c19c258fcf296bc6681f1ac00d128a9df7a3359e4c7b", + "sha256:b5c79142dd3b326278a355de81ba7b7db6f0bc141d9c3986665404973617269f" + ], + "index": "pypi", + "version": "==1.1.0" + }, "mccabe": { "hashes": [ "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", @@ -204,6 +220,12 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==20.9" }, + "parse": { + "hashes": [ + "sha256:9ff82852bcb65d139813e2a5197627a94966245c897796760a3a2a8eb66f020b" + ], + "version": "==1.19.0" + }, "pbr": { "hashes": [ "sha256:5fad80b613c402d5b7df7bd84812548b2a61e9977387a80a5fc5c396492b13c9", diff --git a/docs/source/conf.py b/docs/source/conf.py index b19a691..233942f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,3 +1,5 @@ +import re + # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full @@ -18,9 +20,15 @@ # -- Project information ----------------------------------------------------- project = 'HypixelIO' -copyright = '2020, Sunrit Jana' +copyright = '2021, Sunrit Jana' author = 'Sunrit Jana' +version = '' +with open('../discord/__init__.py') as f: + version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) + +release = version + # -- General configuration --------------------------------------------------- @@ -28,9 +36,17 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'recommonmark' + 'recommonmark', + "sphinx.ext.intersphinx", + "sphinx.ext.autodoc", + "sphinx.ext.mathjax", + "sphinx.ext.viewcode", ] +extlinks = { + 'issue': ('https://github.com/janaSunrise/HypixelIO/issues/%s', 'GH-'), +} + source_suffix = { '.rst': 'restructuredtext', '.txt': 'markdown', @@ -51,7 +67,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = 'insegel' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, From 4927b7845c62adfd8f545ec387eac0633f179821 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 17:18:02 +0530 Subject: [PATCH 23/55] Change the Regex conf sphinx --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 233942f..a49d353 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -24,7 +24,7 @@ author = 'Sunrit Jana' version = '' -with open('../discord/__init__.py') as f: +with open('../hypixelio/__init__.py') as f: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) release = version From 27f4a23a1919bc2a2c76d8216f49e6dd3f15296b Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 17:35:25 +0530 Subject: [PATCH 24/55] Fix sphinx and dependencies, and get them working. --- docs/build/doctrees/environment.pickle | Bin 10603 -> 11529 bytes docs/build/doctrees/index.doctree | Bin 4845 -> 4857 bytes docs/build/html/.buildinfo | 2 +- docs/build/html/_static/basic.css | 2 +- docs/build/html/_static/doctools.js | 9 +- .../html/_static/documentation_options.js | 2 +- docs/build/html/_static/language_data.js | 6 +- docs/build/html/_static/pygments.css | 144 +++++++------- docs/build/html/_static/searchtools.js | 28 ++- docs/build/html/_static/underscore.js | 37 +--- docs/build/html/genindex.html | 159 +++++++++------- docs/build/html/index.html | 168 +++++++++------- docs/build/html/objects.inv | Bin 260 -> 265 bytes docs/build/html/search.html | 180 ++++++++++-------- docs/build/html/searchindex.js | 2 +- docs/source/conf.py | 5 +- 16 files changed, 410 insertions(+), 334 deletions(-) diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index a3e43d72f171de40659e41abda4e8694405aad3a..3a7047548eeaa388101640c94d877ab22d11249a 100644 GIT binary patch literal 11529 zcmcIq>yIVJRo|W2dA}d~w()gB@S1q$#!kS-#AMfAdu?WRYv#8k4U zvMlIh<~x-h%T-bGrqn^9;yg&=yt;+G&SuI>1_MaN&2}q&#)|5oSP$YtW%6D%G6cdc ziv-&m1`gc958Z=Gue4a~1!~_*`l?cT!icHTQ?;D%>?P@87VP*qk)`K8_uRA3bZ(G% zi_R}Y(%3KN@)O8^W(Yiiz0n@9v1ixuztR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wNC0&Pc z1ee759ayv22;(vvDxy*1XeC!AsHhT?%Vm-N%^%~FV;z3pErwo*qFb*<HQC-Tkb1Ix0lGAFg^br0MydvDS`nCNNq@LuL-PY>36J-O254qvCu(>N% zr?KM(A(!CsAme*QOZ)2TKAC>~?F)OOuXI{2yqC%fH2spSLK2cK^zZ#U0xHmGIvq(4 z4YH#K-);l6Guxxy8ShDWsZ*mJM^1qSDeWYnNJcva z8`L_;dSf6StODu#13TNQAB+MB9^DXcUkf`8DEiangG&h3mT`F=m#eTiSxI{Vc9iuw z*ukFje7ndu%D2mGbAu|hRI?=M-g9mMURsW+ayPpnsU*Vy;}4sRqkRD`Xy3+#$@(Uo zmhMkjg~!)xJYI&Alhs~??Ss6deGL$9BY2h-_1!Mq!_2!6YXk7~#+RR#rmqdYwDfzF z&kg$}iV9R_mb>f2{f6P>vnhA*jznBl$JFUM*I?_irrIzlY!oDYUM2oEdV<2?^0VgZmWlMdJH6LV{ob!5*G4|wgW&j+Bh8<8DHAP&JVHmEr#6< z=Vk39utKmNW*d|&_7Zr7p+K^q$(e#my~Biqp5?ec4NXdEAA_sM;pZ~{4T~^#+ik$# za#e~cBxxm*1wZ>7_Moo$W7*=;POmW2o?$#WpL(pn6&x5oJlealA~gX2Sx|JQh#Q38 zeta@%2Hc020vSySWqNTmE=-0c z0KYwK@0523g?0k2o%7CmS$I|i_-oYDP6H68z+Eiqq0P~;wIZ}Ls~9ww7q@~3EBe2{ zxX_n3kA4(Qsn~PY(~jZSafXF26jqT4UwDZvBy-kt(0O$ImPdrk^wV3W>z(Yj{{Tsv BM7{t3 diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree index 031644dd9706f3d436a3ab678371db9a85496dcb..c1b81560fc94b5d6a5c8cc4ac2d50b2d0c0f0680 100644 GIT binary patch delta 77 zcmaE>`csvqfpzM;jV#-kteo^S@^e%5vl8tfpzMmjV#-k^vs;CVnT~ki;80$Q*tx&Vq8*-vrF;|VlpZVGAmMZGV^0n V@{@~Wit|g0l2c)3002|u8LI#Q diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo index b925e47..31b91f3 100644 --- a/docs/build/html/.buildinfo +++ b/docs/build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 08ce7dab3522c112c4eb0d66614d476e +config: 01e447c43729fdb351d554f1745eed53 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/build/html/_static/basic.css b/docs/build/html/_static/basic.css index 24a49f0..be19270 100644 --- a/docs/build/html/_static/basic.css +++ b/docs/build/html/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/docs/build/html/_static/doctools.js b/docs/build/html/_static/doctools.js index 7d88f80..61ac9d2 100644 --- a/docs/build/html/_static/doctools.js +++ b/docs/build/html/_static/doctools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for all documentation. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -29,9 +29,14 @@ if (!window.console || !console.firebug) { /** * small helper function to urldecode strings + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL */ jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); + if (!x) { + return x + } + return decodeURIComponent(x.replace(/\+/g, ' ')); }; /** diff --git a/docs/build/html/_static/documentation_options.js b/docs/build/html/_static/documentation_options.js index 2fa8c97..b283bb6 100644 --- a/docs/build/html/_static/documentation_options.js +++ b/docs/build/html/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '', + VERSION: '1.1.1', LANGUAGE: 'None', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/build/html/_static/language_data.js b/docs/build/html/_static/language_data.js index d2b4ee9..863704b 100644 --- a/docs/build/html/_static/language_data.js +++ b/docs/build/html/_static/language_data.js @@ -5,7 +5,7 @@ * This script contains the language-specific data used by searchtools.js, * namely the list of stopwords, stemmer, scorer and splitter. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -13,7 +13,8 @@ var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; -/* Non-minified version JS is _stemmer.js if file is provided */ +/* Non-minified version is copied as a separate JS file, is available */ + /** * Porter Stemmer */ @@ -199,7 +200,6 @@ var Stemmer = function() { - var splitChars = (function() { var result = {}; var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, diff --git a/docs/build/html/_static/pygments.css b/docs/build/html/_static/pygments.css index 1b94522..18cc04d 100644 --- a/docs/build/html/_static/pygments.css +++ b/docs/build/html/_static/pygments.css @@ -1,82 +1,74 @@ -pre { line-height: 125%; margin: 0; } -td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; } -span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; } -td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } -.highlight { background: #f8f8f8; } -.highlight .c { color: #8f5902; font-style: italic } /* Comment */ -.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */ -.highlight .g { color: #000000 } /* Generic */ -.highlight .k { color: #004461; font-weight: bold } /* Keyword */ -.highlight .l { color: #000000 } /* Literal */ -.highlight .n { color: #000000 } /* Name */ -.highlight .o { color: #582800 } /* Operator */ -.highlight .x { color: #000000 } /* Other */ -.highlight .p { color: #000000; font-weight: bold } /* Punctuation */ -.highlight .ch { color: #8f5902; font-style: italic } /* Comment.Hashbang */ -.highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #8f5902 } /* Comment.Preproc */ -.highlight .cpf { color: #8f5902; font-style: italic } /* Comment.PreprocFile */ -.highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */ -.highlight .gd { color: #a40000 } /* Generic.Deleted */ -.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #ef2929 } /* Generic.Error */ +.highlight { background: #f0f0f0; } +.highlight .c { color: #60a0b0; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .ch { color: #60a0b0; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .cpf { color: #60a0b0; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight .gi { color: #00A000 } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ -.highlight .gp { color: #745334 } /* Generic.Prompt */ -.highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */ +.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */ -.highlight .kc { color: #004461; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #004461; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #004461; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #004461; font-weight: bold } /* Keyword.Pseudo */ -.highlight .kr { color: #004461; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #004461; font-weight: bold } /* Keyword.Type */ -.highlight .ld { color: #000000 } /* Literal.Date */ -.highlight .m { color: #990000 } /* Literal.Number */ -.highlight .s { color: #4e9a06 } /* Literal.String */ -.highlight .na { color: #c4a000 } /* Name.Attribute */ -.highlight .nb { color: #004461 } /* Name.Builtin */ -.highlight .nc { color: #000000 } /* Name.Class */ -.highlight .no { color: #000000 } /* Name.Constant */ -.highlight .nd { color: #888888 } /* Name.Decorator */ -.highlight .ni { color: #ce5c00 } /* Name.Entity */ -.highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */ -.highlight .nf { color: #000000 } /* Name.Function */ -.highlight .nl { color: #f57900 } /* Name.Label */ -.highlight .nn { color: #000000 } /* Name.Namespace */ -.highlight .nx { color: #000000 } /* Name.Other */ -.highlight .py { color: #000000 } /* Name.Property */ -.highlight .nt { color: #004461; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #000000 } /* Name.Variable */ -.highlight .ow { color: #004461; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */ -.highlight .mb { color: #990000 } /* Literal.Number.Bin */ -.highlight .mf { color: #990000 } /* Literal.Number.Float */ -.highlight .mh { color: #990000 } /* Literal.Number.Hex */ -.highlight .mi { color: #990000 } /* Literal.Number.Integer */ -.highlight .mo { color: #990000 } /* Literal.Number.Oct */ -.highlight .sa { color: #4e9a06 } /* Literal.String.Affix */ -.highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */ -.highlight .sc { color: #4e9a06 } /* Literal.String.Char */ -.highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */ -.highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #4e9a06 } /* Literal.String.Double */ -.highlight .se { color: #4e9a06 } /* Literal.String.Escape */ -.highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */ -.highlight .si { color: #4e9a06 } /* Literal.String.Interpol */ -.highlight .sx { color: #4e9a06 } /* Literal.String.Other */ -.highlight .sr { color: #4e9a06 } /* Literal.String.Regex */ -.highlight .s1 { color: #4e9a06 } /* Literal.String.Single */ -.highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */ -.highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */ -.highlight .fm { color: #000000 } /* Name.Function.Magic */ -.highlight .vc { color: #000000 } /* Name.Variable.Class */ -.highlight .vg { color: #000000 } /* Name.Variable.Global */ -.highlight .vi { color: #000000 } /* Name.Variable.Instance */ -.highlight .vm { color: #000000 } /* Name.Variable.Magic */ -.highlight .il { color: #990000 } /* Literal.Number.Integer.Long */ \ No newline at end of file +.highlight .gt { color: #0044DD } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #40a070 } /* Literal.Number */ +.highlight .s { color: #4070a0 } /* Literal.String */ +.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60add5 } /* Name.Constant */ +.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mb { color: #40a070 } /* Literal.Number.Bin */ +.highlight .mf { color: #40a070 } /* Literal.Number.Float */ +.highlight .mh { color: #40a070 } /* Literal.Number.Hex */ +.highlight .mi { color: #40a070 } /* Literal.Number.Integer */ +.highlight .mo { color: #40a070 } /* Literal.Number.Oct */ +.highlight .sa { color: #4070a0 } /* Literal.String.Affix */ +.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ +.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ +.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #06287e } /* Name.Function.Magic */ +.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ +.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ +.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ +.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/build/html/_static/searchtools.js b/docs/build/html/_static/searchtools.js index 261ecaa..1a90152 100644 --- a/docs/build/html/_static/searchtools.js +++ b/docs/build/html/_static/searchtools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for the full-text search. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -248,7 +248,7 @@ var Search = { // results left, load the summary and display it if (results.length) { var item = results.pop(); - var listItem = $('
  • '); + var listItem = $('
  • '); var requestUrl = ""; var linkUrl = ""; if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') { @@ -273,9 +273,9 @@ var Search = { if (item[3]) { listItem.append($(' (' + item[3] + ')')); Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); + }, 5); } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { $.ajax({url: requestUrl, dataType: "text", @@ -285,16 +285,16 @@ var Search = { listItem.append(Search.makeSearchSummary(data, searchterms, hlterms)); } Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); + }, 5); }}); } else { // no source available, just display title Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); + }, 5); } } // search finished, update title and status message @@ -379,6 +379,13 @@ var Search = { return results; }, + /** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions + */ + escapeRegExp : function(string) { + return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string + }, + /** * search for full-text terms in the index */ @@ -402,13 +409,14 @@ var Search = { ]; // add support for partial matches if (word.length > 2) { + var word_regex = this.escapeRegExp(word); for (var w in terms) { - if (w.match(word) && !terms[word]) { + if (w.match(word_regex) && !terms[word]) { _o.push({files: terms[w], score: Scorer.partialTerm}) } } for (var w in titleterms) { - if (w.match(word) && !titleterms[word]) { + if (w.match(word_regex) && !titleterms[word]) { _o.push({files: titleterms[w], score: Scorer.partialTitle}) } } diff --git a/docs/build/html/_static/underscore.js b/docs/build/html/_static/underscore.js index 5b55f32..166240e 100644 --- a/docs/build/html/_static/underscore.js +++ b/docs/build/html/_static/underscore.js @@ -1,31 +1,6 @@ -// Underscore.js 1.3.1 -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the MIT license. -// Portions of Underscore are inspired or borrowed from Prototype, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore -(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== -c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, -h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= -b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== -null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= -function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= -e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= -function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, -c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; -b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, -1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; -b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; -b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), -function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ -u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= -function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= -true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); +!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n=n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){ +// Underscore.js 1.12.0 +// https://underscorejs.org +// (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. +var n="1.12.0",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},t=Array.prototype,e=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,g=isFinite,d=!{toString:null}.propertyIsEnumerable("toString"),b=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u=0&&t<=m}}function $(n){return function(r){return null==r?void 0:r[n]}}var G=$("byteLength"),H=J(G),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:K(!1),Y=$("length");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e":">",'"':""","'":"'","`":"`"},Kn=Ln(Cn),Jn=Ln(_n(Cn)),$n=tn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Gn=/(.)^/,Hn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qn=/\\|'|\r|\n|\u2028|\u2029/g;function Xn(n){return"\\"+Hn[n]}var Yn=0;function Zn(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var nr=j((function(n,r){var t=nr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a1)er(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var cr=nr(fr,2);function lr(n,r,t){r=qn(r,t);for(var e,u=nn(n),o=0,i=u.length;o0?0:u-1;o>=0&&o0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),C))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a=3;return r(n,Fn(t,u,4),e,o)}}var wr=_r(1),Ar=_r(-1);function xr(n,r,t){var e=[];return r=qn(r,t),mr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Sr(n,r,t){r=qn(r,t);for(var e=!tr(n)&&nn(n),u=(e||n).length,o=0;o=0}var Er=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Nn(r),e=r.slice(0,-1),r=r[r.length-1]),jr(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=In(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Br(n,r){return jr(n,Rn(r))}function Nr(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;ao&&(o=e);else r=qn(r,t),mr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}function Ir(n,r,t){if(null==r||t)return tr(n)||(n=jn(n)),n[Wn(n.length-1)];var e=tr(n)?En(n):jn(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i1&&(e=Fn(e,r[1])),r=an(n)):(e=Pr,r=er(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u1&&(t=r[1])):(r=jr(er(r,!1,!1),String),e=function(n,t){return!Mr(r,t)}),qr(n,e,t)}));function Wr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function zr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:Wr(n,n.length-r)}function Lr(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=er(r,!0,!0),xr(n,(function(n){return!Mr(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=qn(t,e));for(var u=[],o=[],i=0,a=Y(n);ir?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o=function(r,t){e=null,t&&(u=n.apply(r,t))},i=j((function(i){if(e&&clearTimeout(e),t){var a=!e;e=setTimeout(o,r),a&&(u=n.apply(this,i))}else e=or(o,r,this,i);return u}));return i.cancel=function(){clearTimeout(e),e=null},i},wrap:function(n,r){return nr(r,n)},negate:ar,compose:function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:fr,once:cr,findKey:lr,findIndex:pr,findLastIndex:vr,sortedIndex:hr,indexOf:gr,lastIndexOf:dr,find:br,detect:br,findWhere:function(n,r){return br(n,Dn(r))},each:mr,forEach:mr,map:jr,collect:jr,reduce:wr,foldl:wr,inject:wr,reduceRight:Ar,foldr:Ar,filter:xr,select:xr,reject:function(n,r,t){return xr(n,ar(qn(r)),t)},every:Sr,all:Sr,some:Or,any:Or,contains:Mr,includes:Mr,include:Mr,invoke:Er,pluck:Br,where:function(n,r){return xr(n,Dn(r))},max:Nr,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;ae||void 0===t)return 1;if(t - - - - - - Index — HypixelIO documentation - - - - - - - - - - - + + + + - - - + HypixelIO :: Index -
    -
    -
    + + + + + + + + + + + + + + + + +
    +
    +
    + + -
    - +
    +
    +

    HypixelIO Documentation

    +
    +
    + +
    + +
    +
    +

    Index

    +
    +
    +

    Index

    @@ -39,63 +64,69 @@

    Index

    -
    -
    - -
    -
    - + - +
    - - + \ No newline at end of file diff --git a/docs/build/html/index.html b/docs/build/html/index.html index 6126523..9f563bd 100644 --- a/docs/build/html/index.html +++ b/docs/build/html/index.html @@ -1,36 +1,61 @@ - - - - - - - Welcome to HypixelIO’s documentation! — HypixelIO documentation - - - - - - - - - - - + + + + - - - + HypixelIO :: Welcome to HypixelIO’s documentation! -
    -
    -
    + + + + + + + + + + + + + + + + +
    +
    +
    + + -
    - +
    +
    +

    HypixelIO Documentation

    +
    +
    + +
    + +
    +
    +

    Welcome to HypixelIO’s documentation!

    +
    +
    +

    Welcome to HypixelIO’s documentation!¶

    @@ -46,66 +71,75 @@

    Indices and tables -
    -

    HypixelIO

    +
    + + + -

    Navigation

    +
    -
    -

    Related Topics

    - -
    - - - +
    + + + -
    -

    -
    -
    - + - +
    - - + \ No newline at end of file diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index efdf7d6dedbc498b15e85ad2c598a46829862c1b..4f477b972e58cfa4a7e8f0715bed493930d8e4fe 100644 GIT binary patch delta 15 VcmZo+>SUT=%W9|xgcEI#0{|dF1ZV&N delta 9 QcmeBVYGImSJJIPl01s3Hc>n+a diff --git a/docs/build/html/search.html b/docs/build/html/search.html index c85d70e..5439156 100644 --- a/docs/build/html/search.html +++ b/docs/build/html/search.html @@ -1,110 +1,140 @@ - - - - - - - Search — HypixelIO documentation - - - - - - - - - - - - + + - - + + + HypixelIO :: Search - + + + + + + + + + + + + + + + + + +
    +
    +
    + + + - - +
    +
    +

    HypixelIO Documentation

    +
    +
    -
    -
    -
    +
    + +
    +
    +

    Search

    +
    +
    + -
    - -

    Search

    -
    - -

    - Please activate JavaScript to enable the search - functionality. -

    -
    -

    - Searching for multiple words only shows matches that contain - all words. -

    -
    - - - -
    - +
    -
    - +
    - -
    -
    -
    - - +
    - - + \ No newline at end of file diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index 9818cf7..ddaef20 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["index.rst"],objects:{},objnames:{},objtypes:{},terms:{index:0,modul:0,page:0,search:0},titles:["Welcome to HypixelIO\u2019s documentation!"],titleterms:{document:0,hypixelio:0,indic:0,tabl:0,welcom:0}}) \ No newline at end of file +Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["index.rst"],objects:{},objnames:{},objtypes:{},terms:{index:0,modul:0,page:0,search:0},titles:["Welcome to HypixelIO\u2019s documentation!"],titleterms:{document:0,hypixelio:0,indic:0,tabl:0,welcom:0}}) \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index a49d353..b53963c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -24,9 +24,10 @@ author = 'Sunrit Jana' version = '' -with open('../hypixelio/__init__.py') as f: - version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) +# -- Version config -- +with open('../../hypixelio/__init__.py') as f: + version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) release = version From a5c29eaacbce572971bda4c2735464d99c69112b Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 17:35:33 +0530 Subject: [PATCH 25/55] Fix sphinx and dependencies, and get them working. --- Pipfile | 3 +- Pipfile.lock | 244 +++++++++++++++++++++++++++++++++++++++++++++++++-- setup.py | 2 +- 3 files changed, 240 insertions(+), 9 deletions(-) diff --git a/Pipfile b/Pipfile index 62c0234..03a07b5 100644 --- a/Pipfile +++ b/Pipfile @@ -13,10 +13,11 @@ pre-commit = "~=2.8.2" pytest-benchmark = "*" bandit = "*" insegel = "*" +recommonmark = "*" [packages] hypixelio = {editable = true, path = "."} -requests = "==2.25.0" +requests = "==2.25.1" requests-cache = "==0.5.2" [scripts] diff --git a/Pipfile.lock b/Pipfile.lock index 2604fec..d885fd2 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "871b09bebb46586e91b3808246c99ce2e2aab9f1680d2ba8a6b5f4f832b69904" + "sha256": "72b02191f25e2a1ba13a22a61d2e4c97b862eccdeae23fe6e98e35bf319fbb43" }, "pipfile-spec": 6, "requires": {}, @@ -23,10 +23,11 @@ }, "chardet": { "hashes": [ - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" + "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa", + "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5" ], - "version": "==3.0.4" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==4.0.0" }, "hypixelio": { "editable": true, @@ -42,11 +43,11 @@ }, "requests": { "hashes": [ - "sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8", - "sha256:e786fa28d8c9154e6a4de5d46a1d921b8749f8b74e28bde23768e5e16eece998" + "sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804", + "sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e" ], "index": "pypi", - "version": "==2.25.0" + "version": "==2.25.1" }, "requests-cache": { "hashes": [ @@ -66,6 +67,13 @@ } }, "develop": { + "alabaster": { + "hashes": [ + "sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359", + "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02" + ], + "version": "==0.7.12" + }, "appdirs": { "hashes": [ "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41", @@ -89,6 +97,14 @@ "index": "pypi", "version": "==1.5.5" }, + "babel": { + "hashes": [ + "sha256:9d35c22fcc79893c3ecc85ac4a56cde1ecf3f19c540bba0922308a6c06ca6fa5", + "sha256:da031ab54472314f210b0adcff1588ee5d1d1d0ba4dbd07b94dba82bde791e05" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.9.0" + }, "bandit": { "hashes": [ "sha256:216be4d044209fa06cf2a3e51b319769a51be8318140659719aa7a115c35ed07", @@ -97,6 +113,13 @@ "index": "pypi", "version": "==1.7.0" }, + "certifi": { + "hashes": [ + "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c", + "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830" + ], + "version": "==2020.12.5" + }, "cfgv": { "hashes": [ "sha256:32e43d604bbe7896fe7c248a9c2276447dbef840feb28fe20494f62af110211d", @@ -105,6 +128,21 @@ "markers": "python_full_version >= '3.6.1'", "version": "==3.2.0" }, + "chardet": { + "hashes": [ + "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa", + "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==4.0.0" + }, + "commonmark": { + "hashes": [ + "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60", + "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9" + ], + "version": "==0.9.1" + }, "datarum": { "hashes": [ "sha256:4c4f1aca4da9d38126b91d3488be950b29eced61757b83a30c06587d38ba4566", @@ -120,6 +158,14 @@ ], "version": "==0.3.1" }, + "docutils": { + "hashes": [ + "sha256:0c5b78adfbf7762415433f5515cd5c9e762339e23369dbe8000d84a4bf4ab3af", + "sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==0.16" + }, "filelock": { "hashes": [ "sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59", @@ -183,6 +229,22 @@ "markers": "python_full_version >= '3.6.1'", "version": "==2.1.0" }, + "idna": { + "hashes": [ + "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6", + "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.10" + }, + "imagesize": { + "hashes": [ + "sha256:6965f19a6a2039c7d48bca7dba2473069ff854c36ae6f19d2cde309d998228a1", + "sha256:b1f6b5a4eab1f73479a50fb79fcf729514a900c341d8503d62a62dbc4127a2b1" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==1.2.0" + }, "iniconfig": { "hashes": [ "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3", @@ -198,6 +260,72 @@ "index": "pypi", "version": "==1.1.0" }, + "jinja2": { + "hashes": [ + "sha256:03e47ad063331dd6a3f04a43eddca8a966a26ba0c5b7207a9a9e4e08f1b29419", + "sha256:a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==2.11.3" + }, + "markupsafe": { + "hashes": [ + "sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473", + "sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161", + "sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235", + "sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5", + "sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42", + "sha256:195d7d2c4fbb0ee8139a6cf67194f3973a6b3042d742ebe0a9ed36d8b6f0c07f", + "sha256:22c178a091fc6630d0d045bdb5992d2dfe14e3259760e713c490da5323866c39", + "sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff", + "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b", + "sha256:2beec1e0de6924ea551859edb9e7679da6e4870d32cb766240ce17e0a0ba2014", + "sha256:3b8a6499709d29c2e2399569d96719a1b21dcd94410a586a18526b143ec8470f", + "sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1", + "sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e", + "sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183", + "sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66", + "sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b", + "sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1", + "sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15", + "sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1", + "sha256:6f1e273a344928347c1290119b493a1f0303c52f5a5eae5f16d74f48c15d4a85", + "sha256:6fffc775d90dcc9aed1b89219549b329a9250d918fd0b8fa8d93d154918422e1", + "sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e", + "sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b", + "sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905", + "sha256:7fed13866cf14bba33e7176717346713881f56d9d2bcebab207f7a036f41b850", + "sha256:84dee80c15f1b560d55bcfe6d47b27d070b4681c699c572af2e3c7cc90a3b8e0", + "sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735", + "sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d", + "sha256:98bae9582248d6cf62321dcb52aaf5d9adf0bad3b40582925ef7c7f0ed85fceb", + "sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e", + "sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d", + "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c", + "sha256:a6a744282b7718a2a62d2ed9d993cad6f5f585605ad352c11de459f4108df0a1", + "sha256:acf08ac40292838b3cbbb06cfe9b2cb9ec78fce8baca31ddb87aaac2e2dc3bc2", + "sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21", + "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2", + "sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5", + "sha256:b1dba4527182c95a0db8b6060cc98ac49b9e2f5e64320e2b56e47cb2831978c7", + "sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b", + "sha256:b7d644ddb4dbd407d31ffb699f1d140bc35478da613b441c582aeb7c43838dd8", + "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6", + "sha256:bf5aa3cbcfdf57fa2ee9cd1822c862ef23037f5c832ad09cfea57fa846dec193", + "sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f", + "sha256:caabedc8323f1e93231b52fc32bdcde6db817623d33e100708d9a68e1f53b26b", + "sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f", + "sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2", + "sha256:d53bc011414228441014aa71dbec320c66468c1030aae3a6e29778a3382d96e5", + "sha256:d73a845f227b0bfe8a7455ee623525ee656a9e2e749e4742706d80a6065d5e2c", + "sha256:d9be0ba6c527163cbed5e0857c451fcd092ce83947944d6c14bc95441203f032", + "sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7", + "sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be", + "sha256:feb7b34d6325451ef96bc0e36e1a6c0c1c64bc1fbec4b854f4529e51887b1621" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==1.1.1" + }, "mccabe": { "hashes": [ "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", @@ -280,6 +408,14 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.2.0" }, + "pygments": { + "hashes": [ + "sha256:37a13ba168a02ac54cc5891a42b1caec333e59b66addb7fa633ea8a6d73445c0", + "sha256:b21b072d0ccdf29297a82a2363359d99623597b8a265b8081760e4d0f7153c88" + ], + "markers": "python_version >= '3.5'", + "version": "==2.8.0" + }, "pyparsing": { "hashes": [ "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1", @@ -304,6 +440,13 @@ "index": "pypi", "version": "==3.2.3" }, + "pytz": { + "hashes": [ + "sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da", + "sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798" + ], + "version": "==2021.1" + }, "pyyaml": { "hashes": [ "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf", @@ -331,6 +474,22 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", "version": "==5.4.1" }, + "recommonmark": { + "hashes": [ + "sha256:1b1db69af0231efce3fa21b94ff627ea33dee7079a01dd0a7f8482c3da148b3f", + "sha256:bdb4db649f2222dcd8d2d844f0006b958d627f732415d399791ee436a3686d67" + ], + "index": "pypi", + "version": "==0.7.1" + }, + "requests": { + "hashes": [ + "sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804", + "sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e" + ], + "index": "pypi", + "version": "==2.25.1" + }, "six": { "hashes": [ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", @@ -347,6 +506,69 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==3.0.5" }, + "snowballstemmer": { + "hashes": [ + "sha256:b51b447bea85f9968c13b650126a888aabd4cb4463fca868ec596826325dedc2", + "sha256:e997baa4f2e9139951b6f4c631bad912dfd3c792467e2f03d7239464af90e914" + ], + "version": "==2.1.0" + }, + "sphinx": { + "hashes": [ + "sha256:672cfcc24b6b69235c97c750cb190a44ecd72696b4452acaf75c2d9cc78ca5ff", + "sha256:ef64a814576f46ec7de06adf11b433a0d6049be007fefe7fd0d183d28b581fac" + ], + "markers": "python_version >= '3.5'", + "version": "==3.5.2" + }, + "sphinxcontrib-applehelp": { + "hashes": [ + "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a", + "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58" + ], + "markers": "python_version >= '3.5'", + "version": "==1.0.2" + }, + "sphinxcontrib-devhelp": { + "hashes": [ + "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e", + "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4" + ], + "markers": "python_version >= '3.5'", + "version": "==1.0.2" + }, + "sphinxcontrib-htmlhelp": { + "hashes": [ + "sha256:3c0bc24a2c41e340ac37c85ced6dafc879ab485c095b1d65d2461ac2f7cca86f", + "sha256:e8f5bb7e31b2dbb25b9cc435c8ab7a79787ebf7f906155729338f3156d93659b" + ], + "markers": "python_version >= '3.5'", + "version": "==1.0.3" + }, + "sphinxcontrib-jsmath": { + "hashes": [ + "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178", + "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8" + ], + "markers": "python_version >= '3.5'", + "version": "==1.0.1" + }, + "sphinxcontrib-qthelp": { + "hashes": [ + "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72", + "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6" + ], + "markers": "python_version >= '3.5'", + "version": "==1.0.3" + }, + "sphinxcontrib-serializinghtml": { + "hashes": [ + "sha256:eaa0eccc86e982a9b939b2b82d12cc5d013385ba5eadcc7e4fed23f4405f77bc", + "sha256:f242a81d423f59617a8e5cf16f5d4d74e28ee9a66f9e5b637a18082991db5a9a" + ], + "markers": "python_version >= '3.5'", + "version": "==1.1.4" + }, "stevedore": { "hashes": [ "sha256:3a5bbd0652bf552748871eaa73a4a8dc2899786bc497a2aa1fcb4dcdb0debeee", @@ -363,6 +585,14 @@ "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==0.10.2" }, + "urllib3": { + "hashes": [ + "sha256:1b465e494e3e0d8939b50680403e3aedaa2bc434b7d5af64dfd3c958d7f5ae80", + "sha256:de3eedaad74a2683334e282005cd8d7f22f4d55fa690a2a1020a416cb0a47e73" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", + "version": "==1.26.3" + }, "virtualenv": { "hashes": [ "sha256:147b43894e51dd6bba882cf9c282447f780e2251cd35172403745fc381a0a80d", diff --git a/setup.py b/setup.py index 80bc002..863c565 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ ), install_requires=[ - 'requests==2.25.0', + 'requests==2.25.1', 'requests-cache==0.5.2' ], From 17d82abe3ab7012b68980a4d917846356e34189e Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 17:41:42 +0530 Subject: [PATCH 26/55] Add CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..4a325a3 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at warriordefenderz@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From b9426c0d2752cb2bb4385a3bbf73c691b7286826 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 18:08:59 +0530 Subject: [PATCH 27/55] Write documentation. --- docs/build/doctrees/environment.pickle | Bin 11529 -> 43250 bytes docs/build/doctrees/index.doctree | Bin 4857 -> 7095 bytes docs/build/html/_sources/index.rst.txt | 39 +++++--- docs/build/html/genindex.html | 119 ++++++++++++++++++++++++- docs/build/html/index.html | 45 ++++++---- docs/build/html/objects.inv | Bin 265 -> 497 bytes docs/build/html/search.html | 5 +- docs/build/html/searchindex.js | 2 +- docs/source/api.rst | 44 +++++++++ docs/source/index.rst | 39 +++++--- hypixelio/lib/client.py | 17 +++- 11 files changed, 263 insertions(+), 47 deletions(-) create mode 100644 docs/source/api.rst diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 3a7047548eeaa388101640c94d877ab22d11249a..76da6a9f56f51623f9f5586aa802624bafcc1fae 100644 GIT binary patch literal 43250 zcmeHwdu&|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X%d2Vv}!jm{KhbH*VP{mB4rrNaN2O2(@ovb+Kxn2k)V%rQ%N;Dqa^Vj92kE zE0xVwE{!)p345^*Vh)`@;TIK`bU;*rC;|~+FP5$@25mUdDq(SV+kxr~lMQvPMjYIB z7P`V-O%?wmaGUu!KPu69`y=+?%;H#>a@Ex~)yTw=6q%{_;XC{L%%_`uGGFhBU@vYP z&dS#-5R@upzQ~7&7``;Q_-h+FelOfG{(#3>Id7-@%?lCUz7Rna>Cmn6##C0VTG>~t z{01x=b*a^<=i`uJUCxtskp+5z`V5DsT35E+aA0@Kfe+N|&JSY=@t&t`$bEz=gO>t^RtbMzZB4<<Q(9Ycel%dCZx;p~UO^P~?S!qMj98g>0y_=soz5A-^hcobHgoAF)92)gkEUwtpmetK}KSuwtY zx0!RO;lQH!Zc@Im{7Hx%i|&uAxZfq@)jcwv0TO4=c~$n`A+GS{+xZuwwnvwDy7ZF{ zmHp28?)Ddu$aq%hWsfZE+Rw9K$W+`P87KJLQ-X>&ZocIM-ndXp^8P456}`8x(Dh=R M-BNif9#pURA26%aJOBUy diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree index c1b81560fc94b5d6a5c8cc4ac2d50b2d0c0f0680..3a9d4d530cc138152a4b33de4e8a75542394978d 100644 GIT binary patch literal 7095 zcmd5>+ix6K8TV~%ukUeUgRlb=tAOjoy9M!pqNpXIX$fu}luL^O?d0st**&wKote&@ zvAva$(ubl39U-I)5)$PBRlM;B@PLr`3wVP{h?l-0{s1H%5Wnxtb=TPIN>rliZuWfV zJLi1&o1fHv{@aZ){hwNn0^xYa4QAV(Z}TWov$k)=J?_cmS@QgQ$&Zq4RS(%wm_9XD!Z=Vu~rNyqn!}#mrmDwy3L`bfn8GTWal1?pl72 z8`3wv(+`|u?%uh3C7}brpL)QLiICIK-cK}zc;cd(4j5>XiMSxf#iW|fDBf37uH*4! zKW;HK$D|CMRxH6OaW?7L5pgkNxh#qR#P6ENdg-rOI}XZ4i&+ODZxc?eW+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4dCpx*C=ouYcEnEtU4YZ1{ctD*}@L@!UE90SvX1H*yuPqU0 z+?@r9ol2`aw6`GN{Z?a>^xb7y#q=5j_DL{bkHxQU1+z5_R(0WqRU&3lH@^2#+ kFccuV@N`. -Indices and tables -================== -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` +Modules and manuals +------------------- + +These pages have info, documentation and help, all you need to learn and use this library! + +.. toctree:: + :maxdepth: 1 + + api \ No newline at end of file diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index 1c72232..176b4e0 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -60,8 +60,122 @@

    Index

    Index

    + _ + | C + | F + | G + | M + | P + | U
    +

    _

    + + +
    + +

    C

    + + + +
    + +

    F

    + + +
    + +

    G

    + + + +
    + +

    M

    + + +
    + +

    P

    + + +
      +
    • + Python Enhancement Proposals + +
    • +
    + +

    U

    + + + +
    +
    @@ -84,7 +198,10 @@

    Index

    -
    + + diff --git a/docs/build/html/index.html b/docs/build/html/index.html index 9f563bd..7b94ab3 100644 --- a/docs/build/html/index.html +++ b/docs/build/html/index.html @@ -5,7 +5,7 @@ - HypixelIO :: Welcome to HypixelIO’s documentation! + HypixelIO :: Welcome to HypixelIO! @@ -52,22 +52,38 @@

    HypixelIO Documentation

    -

    Welcome to HypixelIO’s documentation!

    +

    Welcome to HypixelIO!

    -
    -

    Welcome to HypixelIO’s documentation!¶

    +
    +

    Welcome to HypixelIO!¶

    +

    HypixelIO is a modern hypixel API wrapper library that suits all your needs. It supports both sync +and async programming, with easy to use features in mind.

    +

    Features

    +
      +
    • Modern way of handling requests

    • +
    • Both async and sync support.

    • +
    • Simple rate handling, and caching.

    • +
    • Speed optimized

    • +
    • Easy to use with a modern and simple design

    • +
    +
    +

    Getting started¶

    +

    Is this your first time using the library? This is the place to get started!

    + +
    +
    +

    Modules and manuals¶

    +

    These pages have info, documentation and help, all you need to learn and use this library!

    +
    -
    -

    Indices and tables¶

    -
    @@ -91,11 +107,10 @@

    Indices and tables

    + diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index 4f477b972e58cfa4a7e8f0715bed493930d8e4fe..ece1ee07d4ba9ab33ab85eac0622f595313f5ef1 100644 GIT binary patch delta 382 zcmV-^0fGLB0`UWoe1DykO;5ux42JLh6+v)aC9b<6F6@AqK!{_MCT*+IP=DYn6h6DW&WZv2O%V4W zqa}6dwg`a)^|@@=43$N>;ho3YSjfbG1WB#1ncrx1Tkwa4ySCeZ;X=RA%l7<8PEgo@3(6vq!1NG%mgwmACO(|X0;p#~35LeYSW|4i6T zQY$L3qxfJ=#A-YiN7+8&iQ)^a#JC!S>?PfC^>$aZsQ!uF4U2;#!LO+L_~cTS6Ymvl cJ;X`4b2@Search -
    + + diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index ddaef20..6438274 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["index.rst"],objects:{},objnames:{},objtypes:{},terms:{index:0,modul:0,page:0,search:0},titles:["Welcome to HypixelIO\u2019s documentation!"],titleterms:{document:0,hypixelio:0,indic:0,tabl:0,welcom:0}}) \ No newline at end of file +Search.setIndex({docnames:["api","index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["api.rst","index.rst"],objects:{"hypixelio.Client":{find_guild:[0,1,1,""],get_boosters:[0,1,1,""],get_friends:[0,1,1,""],get_games_info:[0,1,1,""],get_guild:[0,1,1,""],get_key_info:[0,1,1,""],get_leaderboards:[0,1,1,""],get_player:[0,1,1,""],get_player_recent_games:[0,1,1,""],get_player_status:[0,1,1,""],get_skyblock_profile:[0,1,1,""],get_watchdog_info:[0,1,1,""]},"hypixelio.Converters":{url:[0,2,1,""],username_to_uuid:[0,1,1,""],uuid_to_username:[0,1,1,""]},"hypixelio.Utils":{get_avatar:[0,1,1,""],get_body:[0,1,1,""],get_head:[0,1,1,""],get_name_history:[0,1,1,""],mojang_url:[0,2,1,""],url:[0,2,1,""]},hypixelio:{Client:[0,0,1,""],Converters:[0,0,1,""],Utils:[0,0,1,""],__version__:[0,3,1,""]}},objnames:{"0":["py","class","Python class"],"1":["py","method","Python method"],"2":["py","attribute","Python attribute"],"3":["py","data","Python data"]},objtypes:{"0":"py:class","1":"py:method","2":"py:attribute","3":"py:data"},terms:{"0b1":0,"440":0,"class":0,"default":0,"function":0,"import":0,"new":0,"return":0,"true":0,The:0,Their:0,There:0,These:1,__version__:0,about:0,access:0,account:0,all:[0,1],along:0,api:1,api_kei:0,async:1,attribut:0,authent:0,avail:1,avatar:0,base:0,being:0,bodi:0,bool:0,booster:0,both:1,cach:[0,1],cache_config:0,certain:0,chang:0,changed_at:0,check:0,classmethod:0,coin:0,command:0,contain:0,convers:0,dai:0,data:0,depict:0,design:1,dict:0,dictionari:0,document:1,each:0,easi:1,either:0,end:0,exampl:1,fals:0,featur:1,few:0,find:0,find_guild:0,findguild:0,first:1,friend:0,game:0,gener:0,get:0,get_avatar:0,get_bodi:0,get_boost:0,get_friend:0,get_games_info:0,get_guild:0,get_head:0,get_key_info:0,get_leaderboard:0,get_name_histori:0,get_play:0,get_player_recent_gam:0,get_player_statu:0,get_skyblock_profil:0,get_watchdog_info:0,global:0,guild:0,guild_nam:0,handl:[0,1],has:0,have:1,head:0,help:1,his:0,histori:0,hypixel:[0,1],hypixelio:0,imag:0,index:[],info:1,inform:0,its:0,kei:0,last:0,leaderboard:0,learn:1,librari:[0,1],list:0,load:0,mani:1,method:0,mind:1,minecraft:0,model:0,modern:1,modul:[],mojang_url:0,name:0,name_histori:0,need:[0,1],none:0,object:0,off:0,optim:1,option:0,page:1,pass:0,pep:0,place:1,plai:0,player:0,player_statu:0,player_uuid:0,playerstatu:0,profil:0,program:1,rank:0,rate:1,recent:0,recent_gam:0,recentgam:0,record:0,render:0,repositori:1,represent:0,request:[0,1],requir:0,resourc:1,respect:0,search:[],simpl:1,singl:0,skin:0,skyblock:0,skyblockprofil:0,sourc:0,specif:0,specifi:0,speed:1,stat:0,statu:0,str:0,string:0,suit:1,support:1,sync:1,thi:[0,1],thing:0,time:1,toggl:0,union:0,url:0,usag:0,use:[0,1],used:0,user:0,usernam:0,username_to_uuid:0,using:[0,1],uuid:0,uuid_to_usernam:0,valu:0,wai:[0,1],watchdog:0,when:0,which:0,whole:0,wrapper:[0,1],you:[0,1],your:[0,1]},titles:["API Reference","Welcome to HypixelIO!"],titleterms:{api:0,client:0,convert:0,document:[],get:1,hypixelio:1,indic:[],info:0,manual:1,modul:1,refer:0,relat:0,start:1,tabl:[],util:0,version:0,welcom:1}}) \ No newline at end of file diff --git a/docs/source/api.rst b/docs/source/api.rst new file mode 100644 index 0000000..ac2f740 --- /dev/null +++ b/docs/source/api.rst @@ -0,0 +1,44 @@ +.. currentmodule:: hypixelio + +API Reference +============= + +Version Related Info +--------------------- + +There is a single way to check the version for this library. + +.. data:: __version__ + + A string representation of the version. e.g. ``'0.1.0b1'``. This is based + off of :pep:`440`. + +Clients +------- + +Client +~~~~~~ + +.. autoclass:: Client + :members: + :undoc-members: + +Converters +---------- + +Converter +~~~~~~~~~ + +.. autoclass:: Converters + :members: + :undoc-members: + +Utility +------- + +Utils +~~~~~ + +.. autoclass:: Utils + :members: + :undoc-members: diff --git a/docs/source/index.rst b/docs/source/index.rst index 23987fd..1e44f80 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,20 +1,31 @@ -.. HypixelIO documentation master file, created by - sphinx-quickstart on Fri Nov 13 13:33:46 2020. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to HypixelIO's documentation! +Welcome to HypixelIO! ===================================== -.. toctree:: - :maxdepth: 2 - :caption: Contents: +HypixelIO is a modern hypixel API wrapper library that suits all your needs. It supports both sync +and async programming, with easy to use features in mind. + +**Features** + +- Modern way of handling requests +- Both async and sync support. +- Simple rate handling, and caching. +- Speed optimized +- Easy to use with a modern and simple design + +Getting started +----------------- +Is this your first time using the library? This is the place to get started! +- **Examples:** Many examples are available in the :resource:`repository `. -Indices and tables -================== -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` +Modules and manuals +------------------- + +These pages have info, documentation and help, all you need to learn and use this library! + +.. toctree:: + :maxdepth: 1 + + api \ No newline at end of file diff --git a/hypixelio/lib/client.py b/hypixelio/lib/client.py index 3e9b041..9b78a49 100644 --- a/hypixelio/lib/client.py +++ b/hypixelio/lib/client.py @@ -330,7 +330,7 @@ def get_player_recent_games( self, name: t.Optional[str] = None, uuid: t.Optional[str] = None ) -> recent_games.RecentGames: """ - Get the recent games played by a Hypixel Player using either his Username or UUID. + Get the recent games played by a Hypixel Player using either his Username or UUID. Parameters ---------- @@ -361,6 +361,21 @@ def get_player_recent_games( def get_skyblock_profile( self, name: t.Optional[str] = None, uuid: t.Optional[str] = None ) -> skyblock.SkyblockProfile: + """ + Get the skyblock information and profile about a specific used as passed in the requirements. + + Parameters + ---------- + name: str + The player's name in Hypixel + uuid: str + The player's global UUID + + Returns + ------- + skyblock.SkyblockProfile + The skyblock profile model for the user. + """ if name: uuid = Converters.username_to_uuid(name) json, success = self._fetch(self.url["skyblock_profile"], {"profile": uuid}) From 76e5a769e9935ad76e26992d94ae652d7af724a0 Mon Sep 17 00:00:00 2001 From: janaSunrise Date: Sat, 6 Mar 2021 18:31:05 +0530 Subject: [PATCH 28/55] Write documentation and fix styling WIP. --- docs/build/doctrees/environment.pickle | Bin 43250 -> 44404 bytes docs/build/html/searchindex.js | 2 +- hypixelio/lib/client.py | 40 +++++++++++++++++++++---- hypixelio/models/caching/backend.py | 1 - 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 76da6a9f56f51623f9f5586aa802624bafcc1fae..5e7f4a12aeaf05d761848e51f8fb94a70bf20afc 100644 GIT binary patch delta 7575 zcmd5>eQZWgaApz#UaEQjxpa!NJ0{mPuEHKXf;--dA6_P_i+5e^E2S8 zZQ3dco9YSZ_5Rq_sjS)t>x9OX|0>ZzE3s9jqSaQl-K4FXs%@%3Yr9ILQwKZu-e>zJ z*rPAor1_8Y-Z}T&-#zzt&;5G-^zFRQev?=5RKd68i$5!&W*}Ww~FC9LJiDwWwnv zo=ntHBl$HtZ@Ek!UuUStlIvADTf{6Jf!4y z{30#9LIrD*)l4kXRliVt8Hy7nzF0Vnb#GXX>PeE!8W(dcq8?sZ$K%|sRE(cIQonuK z+|FDkFVwG^XS)Ve)R1%Qmb6n}{ZiVlhZSBInkxnq;AT&Z;YagGV+pY|8B%CCZ^LjsY*@-Q zsF7IKk9A#+j3KhKp?r{ye%ch(B}lA*G5!rES?cCFQVG>K%~mr25ZmD-Ct0aUL##Ce zF)3gqgaqQz)H0}?eA*UD=n9V-h`~fa61lNq1STKO<+$FdrMJv1!A z3W^3JLDg7Bubb(X!OjQvugquXbu%#8*|}y0LR?Ihzo!{~jWe8US6Wa`0eE7uD=g!P z9!*Xsd8&3ZV$)_mz8{`EQzhcnsF1~pR>H3qiZ3>7)@zob5MgGe2? zGE<<_Oba4WnMHUPgWyNnBU$#HoJX()O@Xsps$Gn&qBM^NSw1seF&5s%Ti4E?1zs~S z*%>)x1|r8SIA{h#3?nlO_`v*s&Vt1c>2g@sfZElXk>F+-}Xg~;w0?Nd^1;Vg#Zf0|Lssb*z*^gnPJ8I^Wb165@ zy)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