From c9ef35684df7e2d7c6652bdfb5829ccd883cb23b Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Sun, 1 Oct 2023 16:11:58 +0200 Subject: [PATCH 01/12] fix: removed pytests in dist --- setup.py | 10 +++++----- tests/client/__init__.py | 0 tests/{ => client}/test_client.py | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 tests/client/__init__.py rename tests/{ => client}/test_client.py (88%) diff --git a/setup.py b/setup.py index c1bfa08..7010c7e 100644 --- a/setup.py +++ b/setup.py @@ -5,12 +5,12 @@ with open('requirements.txt') as requirements_txt: requirements = requirements_txt.read().splitlines() - print(requirements) with open('README.md', 'r', encoding='utf-8') as readme_md: readme = readme_md.read() -packages = find_packages(exclude=["testing", "tests"]) +packages = find_packages(exclude=["testing*", "tests*"]) +print(packages) setup( name='pyclasher', @@ -23,9 +23,9 @@ long_description_content_type='text/markdown', packages=packages, install_requires=requirements, - tests_require=[ - 'pytest', - ], + # tests_require=[ + # 'pytest', + # ], url='https://github.com/201st-Luka/PyClasher', classifiers=[ 'Development Status :: 5 - Production/Stable', diff --git a/tests/client/__init__.py b/tests/client/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_client.py b/tests/client/test_client.py similarity index 88% rename from tests/test_client.py rename to tests/client/test_client.py index c6d6333..5c7c19f 100644 --- a/tests/test_client.py +++ b/tests/client/test_client.py @@ -4,7 +4,8 @@ from pyclasher import Client -from .constants import CLASH_OF_CLANS_LOGIN_EMAIL, CLASH_OF_CLANS_LOGIN_PASSWORD +from ..constants import (CLASH_OF_CLANS_LOGIN_EMAIL, + CLASH_OF_CLANS_LOGIN_PASSWORD) @pytest.mark.tryfirst From 60e835aa38ed7f0448f040d9525189b7ab0a5846 Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Sun, 1 Oct 2023 16:12:21 +0200 Subject: [PATCH 02/12] fix: fixed test.pypi.org test --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6e5143..ee724f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,9 +35,9 @@ jobs: VERSION=$(python3 -c "import pyclasher; print(pyclasher.__version__)") echo "Package version: $VERSION" echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV - - name: Upload + - name: Upload to test.pypi.org run: python3 -m twine upload -u __token__ -p ${{ secrets.TEST_PYPI_TOKEN }} --repository testpypi --skip-existing dist/* - - name: Test + - name: Test of release run: pip install -i https://test.pypi.org/simple/ pyclasher==$PACKAGE_VERSION - - name: Upload + - name: Upload to pypi.org run: python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} --repository pypi dist/* From 893c09d7c3887336dce177b4ee669f8e9857a7d6 Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Sun, 1 Oct 2023 16:20:51 +0200 Subject: [PATCH 03/12] rebase: bulk request import --- pyclasher/api/bulk_requests/__init__.py | 1 - pyclasher/api/bulk_requests/abc.py | 13 +++++++++++-- pyclasher/api/bulk_requests/abc.pyi | 8 ++++++++ pyclasher/api/bulk_requests/b_player.py | 6 ++++++ pyclasher/api/bulk_requests/b_player.pyi | 15 ++++++++++++--- 5 files changed, 37 insertions(+), 6 deletions(-) diff --git a/pyclasher/api/bulk_requests/__init__.py b/pyclasher/api/bulk_requests/__init__.py index 4a0b6dd..cb65878 100644 --- a/pyclasher/api/bulk_requests/__init__.py +++ b/pyclasher/api/bulk_requests/__init__.py @@ -1,5 +1,4 @@ from .b_player import PlayerBulkRequest -from .abc import BulkRequestModel __all__ = ( "PlayerBulkRequest", diff --git a/pyclasher/api/bulk_requests/abc.py b/pyclasher/api/bulk_requests/abc.py index be43097..2cda076 100644 --- a/pyclasher/api/bulk_requests/abc.py +++ b/pyclasher/api/bulk_requests/abc.py @@ -1,10 +1,18 @@ -from asyncio import gather, get_running_loop, run +from asyncio import gather + + +__all__ = ( + 'BulkRequestModel', +) class BulkRequestModel: _request_model = ... _requests = None + def __init__(self): + self._tasks = None + @property def request_model(self): return self._request_model @@ -29,7 +37,8 @@ def __len__(self): return len(self._requests) def __getitem__(self, item): - self._requests[0].to_dict() # test if the `to_dict()` method raises `RequestNotDone` + self._requests[0].to_dict() + # test if the `to_dict()` method raises `RequestNotDone` if isinstance(item, int): return self._requests[item] if isinstance(item, slice): diff --git a/pyclasher/api/bulk_requests/abc.pyi b/pyclasher/api/bulk_requests/abc.pyi index 9e811e0..c0c55e9 100644 --- a/pyclasher/api/bulk_requests/abc.pyi +++ b/pyclasher/api/bulk_requests/abc.pyi @@ -1,6 +1,11 @@ from typing import Any, Coroutine, Iterator, Generator +__all__ = ( + 'BulkRequestModel', +) + + class BulkRequestModel: """ bulk request base model @@ -16,6 +21,9 @@ class BulkRequestModel: _request_model: Any = ... _requests: list = None + def __init__(self): + self._tasks: list[Coroutine] = ... + @property def request_model(self) -> Any: """ diff --git a/pyclasher/api/bulk_requests/b_player.py b/pyclasher/api/bulk_requests/b_player.py index 0a9e5c2..257b0d3 100644 --- a/pyclasher/api/bulk_requests/b_player.py +++ b/pyclasher/api/bulk_requests/b_player.py @@ -7,10 +7,16 @@ from ...exceptions import MISSING +__all__ = ( + 'PlayerBulkRequest' +) + + class PlayerBulkRequest(BulkRequestModel): _request_model = PlayerRequest def __init__(self, tags): + super().__init__() self._tags = tags self._requests = list(self._request_model(tag) for tag in self.tags) return diff --git a/pyclasher/api/bulk_requests/b_player.pyi b/pyclasher/api/bulk_requests/b_player.pyi index ea22bac..0894968 100644 --- a/pyclasher/api/bulk_requests/b_player.pyi +++ b/pyclasher/api/bulk_requests/b_player.pyi @@ -1,12 +1,21 @@ -from typing import Iterable, Coroutine, Any, Iterator +from typing import Iterable, Iterator from .abc import BulkRequestModel -from ..models import BaseClan, ClanMemberList, ClanWarMemberList, \ - ClanWarLeagueClanMemberList, \ +from ..models import ( + BaseClan, + ClanMemberList, + ClanWarMemberList, + ClanWarLeagueClanMemberList, ClanCapitalRaidSeasonMemberList +) from ..requests import PlayerRequest, ClanMembersRequest +__all__ = ( + 'PlayerBulkRequest', +) + + class PlayerBulkRequest(BulkRequestModel): """ class for requesting multiple players at once in parallel From b115919dc59265c48c612a7834560f09233e84fe Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Sun, 1 Oct 2023 16:23:00 +0200 Subject: [PATCH 04/12] rebase: api models login import --- pyclasher/api/models/login/__init__.py | 8 ++++++++ pyclasher/api/models/login/login_models.py | 8 ++++++++ pyclasher/api/models/login/login_models.pyi | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/pyclasher/api/models/login/__init__.py b/pyclasher/api/models/login/__init__.py index fe4412a..244adb6 100644 --- a/pyclasher/api/models/login/__init__.py +++ b/pyclasher/api/models/login/__init__.py @@ -1 +1,9 @@ from .login_models import Auth, Developer, LoginModel, Status + + +__all__ = ( + 'Status', + 'Auth', + 'Developer', + 'LoginModel' +) diff --git a/pyclasher/api/models/login/login_models.py b/pyclasher/api/models/login/login_models.py index e455190..befc2ab 100644 --- a/pyclasher/api/models/login/login_models.py +++ b/pyclasher/api/models/login/login_models.py @@ -1,6 +1,14 @@ from ..abc import BaseModel +__all__ = ( + 'Status', + 'Auth', + 'Developer', + 'LoginModel' +) + + class Status(BaseModel): """ class representing the status of the ClashOfClans API login diff --git a/pyclasher/api/models/login/login_models.pyi b/pyclasher/api/models/login/login_models.pyi index 68b61cf..202f116 100644 --- a/pyclasher/api/models/login/login_models.pyi +++ b/pyclasher/api/models/login/login_models.pyi @@ -1,6 +1,14 @@ from ..abc import BaseModel +__all__ = ( + 'Status', + 'Auth', + 'Developer', + 'LoginModel' +) + + class Status(BaseModel): """ class representing the status of the ClashOfClans API login From 04ad7d6e121f1113496a84958b8a9008b9f22eff Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Sun, 1 Oct 2023 16:30:40 +0200 Subject: [PATCH 05/12] rebase: api models misc import --- pyclasher/api/models/misc/__init__.py | 14 ++++++++++++++ pyclasher/api/models/misc/api.py | 7 +++++++ pyclasher/api/models/misc/api.pyi | 7 +++++++ pyclasher/api/models/misc/posts.py | 6 ++++++ pyclasher/api/models/misc/posts.pyi | 6 ++++++ pyclasher/api/models/misc/responses.py | 6 ++++++ pyclasher/api/models/misc/responses.pyi | 6 ++++++ pyclasher/api/models/misc/war_status.py | 6 ++++++ pyclasher/api/models/misc/war_status.pyi | 6 ++++++ 9 files changed, 64 insertions(+) diff --git a/pyclasher/api/models/misc/__init__.py b/pyclasher/api/models/misc/__init__.py index 8df21f4..edf3a0d 100644 --- a/pyclasher/api/models/misc/__init__.py +++ b/pyclasher/api/models/misc/__init__.py @@ -2,7 +2,21 @@ ClashOfClans API miscellaneous models """ + from .api import ClientError, Replay, ServiceVersion from .posts import VerifyTokenRequest, DeepLinkCreationRequest from .responses import VerifyTokenResponse, DeepLinkCreationResponse from .war_status import WarStatus, WarStatusList + + +__all__ = ( + 'ClientError', + 'Replay', + 'ServiceVersion', + 'VerifyTokenRequest', + 'DeepLinkCreationRequest', + 'VerifyTokenResponse', + 'DeepLinkCreationResponse', + 'WarStatus', + 'WarStatusList' +) diff --git a/pyclasher/api/models/misc/api.py b/pyclasher/api/models/misc/api.py index 2016ff2..ab409d5 100644 --- a/pyclasher/api/models/misc/api.py +++ b/pyclasher/api/models/misc/api.py @@ -1,6 +1,13 @@ from ..abc import BaseModel +__all__ = ( + 'ClientError', + 'Replay', + 'ServiceVersion' +) + + class ClientError(BaseModel): def __init__(self, data): super().__init__(data) diff --git a/pyclasher/api/models/misc/api.pyi b/pyclasher/api/models/misc/api.pyi index b286c59..e931b03 100644 --- a/pyclasher/api/models/misc/api.pyi +++ b/pyclasher/api/models/misc/api.pyi @@ -6,6 +6,13 @@ from ..abc import BaseModel from ....exceptions import Missing +__all__ = ( + 'ClientError', + 'Replay', + 'ServiceVersion' +) + + class ClientError(BaseModel): """ client error model diff --git a/pyclasher/api/models/misc/posts.py b/pyclasher/api/models/misc/posts.py index a08550a..637e0d5 100644 --- a/pyclasher/api/models/misc/posts.py +++ b/pyclasher/api/models/misc/posts.py @@ -1,3 +1,9 @@ +__all__ = ( + 'VerifyTokenRequest', + 'DeepLinkCreationRequest' +) + + class VerifyTokenRequest: def __init__(self, token): self.token = token diff --git a/pyclasher/api/models/misc/posts.pyi b/pyclasher/api/models/misc/posts.pyi index f77e105..aa209ec 100644 --- a/pyclasher/api/models/misc/posts.pyi +++ b/pyclasher/api/models/misc/posts.pyi @@ -1,3 +1,9 @@ +__all__ = ( + 'VerifyTokenRequest', + 'DeepLinkCreationRequest' +) + + class VerifyTokenRequest: """ verify token request model diff --git a/pyclasher/api/models/misc/responses.py b/pyclasher/api/models/misc/responses.py index b6545a0..7825313 100644 --- a/pyclasher/api/models/misc/responses.py +++ b/pyclasher/api/models/misc/responses.py @@ -2,6 +2,12 @@ from ..enums import TokenStatus +__all__ = ( + 'VerifyTokenResponse', + 'DeepLinkCreationResponse' +) + + class VerifyTokenResponse(BaseModel): def __init__(self, data): super().__init__(data) diff --git a/pyclasher/api/models/misc/responses.pyi b/pyclasher/api/models/misc/responses.pyi index 017007e..f87ade7 100644 --- a/pyclasher/api/models/misc/responses.pyi +++ b/pyclasher/api/models/misc/responses.pyi @@ -2,6 +2,12 @@ from ..abc import BaseModel from ..enums import TokenStatus +__all__ = ( + 'VerifyTokenResponse', + 'DeepLinkCreationResponse' +) + + class VerifyTokenResponse(BaseModel): """ response model for the verify token request diff --git a/pyclasher/api/models/misc/war_status.py b/pyclasher/api/models/misc/war_status.py index 59211bd..4e18605 100644 --- a/pyclasher/api/models/misc/war_status.py +++ b/pyclasher/api/models/misc/war_status.py @@ -3,6 +3,12 @@ from ..enums import ClanWarState +__all__ = ( + 'WarStatus', + 'WarStatusList' +) + + class WarStatus(BaseModel): def __init__(self, data): super().__init__(data) diff --git a/pyclasher/api/models/misc/war_status.pyi b/pyclasher/api/models/misc/war_status.pyi index 7ff6539..ccc2c31 100644 --- a/pyclasher/api/models/misc/war_status.pyi +++ b/pyclasher/api/models/misc/war_status.pyi @@ -5,6 +5,12 @@ from ..base_models import Time from ..enums import ClanWarState +__all__ = ( + 'WarStatus', + 'WarStatusList' +) + + class WarStatus(BaseModel): """ war status model From f3943280f1c2fd5a7324b0b81540a3e68847b74d Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Sun, 1 Oct 2023 21:32:19 +0200 Subject: [PATCH 06/12] rebase: api models import --- pyclasher/api/models/__init__.py | 282 ++++++++++++++---- pyclasher/api/models/abc.py | 6 + pyclasher/api/models/abc.pyi | 6 + pyclasher/api/models/base_models.py | 17 ++ pyclasher/api/models/base_models.pyi | 17 ++ pyclasher/api/models/clan.py | 8 + pyclasher/api/models/clan.pyi | 8 + .../models/clan_builder_base_ranking_list.py | 6 + .../models/clan_builder_base_ranking_list.pyi | 6 + .../api/models/clan_capital_raid_seasons.py | 18 ++ .../api/models/clan_capital_raid_seasons.pyi | 18 ++ .../api/models/clan_capital_ranking_list.py | 6 + .../api/models/clan_capital_ranking_list.pyi | 6 + pyclasher/api/models/clan_list.py | 5 + pyclasher/api/models/clan_list.pyi | 5 + pyclasher/api/models/clan_member.py | 5 + pyclasher/api/models/clan_member.pyi | 5 + pyclasher/api/models/clan_member_list.py | 5 + pyclasher/api/models/clan_member_list.pyi | 5 + pyclasher/api/models/clan_ranking_list.py | 6 + pyclasher/api/models/clan_ranking_list.pyi | 6 + pyclasher/api/models/clan_war.py | 5 + pyclasher/api/models/clan_war.pyi | 5 + pyclasher/api/models/clan_war_league_group.py | 11 + .../api/models/clan_war_league_group.pyi | 11 + pyclasher/api/models/clan_war_log.py | 6 + pyclasher/api/models/clan_war_log.pyi | 6 + pyclasher/api/models/enums.py | 21 ++ pyclasher/api/models/enums.pyi | 21 ++ pyclasher/api/models/gold_pass_season.py | 5 + pyclasher/api/models/gold_pass_season.pyi | 5 + pyclasher/api/models/labels.py | 6 + pyclasher/api/models/labels.pyi | 6 + pyclasher/api/models/language.py | 5 + pyclasher/api/models/language.pyi | 5 + pyclasher/api/models/leagues.py | 14 + pyclasher/api/models/leagues.pyi | 14 + pyclasher/api/models/location.py | 6 + pyclasher/api/models/location.pyi | 6 + pyclasher/api/models/player.py | 12 + pyclasher/api/models/player.pyi | 12 + .../player_builder_base_ranking_list.py | 6 + .../player_builder_base_ranking_list.pyi | 6 + pyclasher/api/models/player_house.py | 7 + pyclasher/api/models/player_house.pyi | 7 + pyclasher/api/models/player_ranking_clan.py | 5 + pyclasher/api/models/player_ranking_list.py | 6 + pyclasher/api/models/player_ranking_list.pyi | 6 + pyclasher/api/models/season.py | 5 + pyclasher/api/models/season.pyi | 5 + pyclasher/api/models/war_clan.py | 9 + pyclasher/api/models/war_clan.pyi | 9 + 52 files changed, 645 insertions(+), 54 deletions(-) diff --git a/pyclasher/api/models/__init__.py b/pyclasher/api/models/__init__.py index be3dd99..b70258c 100644 --- a/pyclasher/api/models/__init__.py +++ b/pyclasher/api/models/__init__.py @@ -2,108 +2,282 @@ ClashOfClans API models """ # abc -from .abc import BaseModel, IterBaseModel +from .abc import ( + BaseModel, + IterBaseModel +) # base models, miscellaneous models and enums from .base_models import ( - ImageUrl, IconUrl, IconUrls, After, Before, - Cursor, Paging, BadgeUrl, BadgeUrls, Time, - BaseClanMember, BaseClan, + ImageUrl, + IconUrl, + IconUrls, + After, + Before, + Cursor, + Paging, + BadgeUrl, + BadgeUrls, + Time, + BaseClanMember, + BaseClan, BaseLeague ) # clan models -from .clan import ClanDistrictData, ClanDistrictDataList, ClanCapital, Clan +from .clan import ( + ClanDistrictData, + ClanDistrictDataList, + ClanCapital, + Clan +) from .clan_builder_base_ranking_list import ( - ClanBuilderBaseRanking, ClanBuilderBaseRankingList + ClanBuilderBaseRanking, + ClanBuilderBaseRankingList ) from .clan_capital_raid_seasons import ( - ClanCapitalRaidSeasonClanInfo, ClanCapitalRaidSeasonAttacker, - ClanCapitalRaidSeasonAttack, ClanCapitalRaidSeasonAttackList, - ClanCapitalRaidSeasonDistrict, ClanCapitalRaidSeasonDistrictList, + ClanCapitalRaidSeasonClanInfo, + ClanCapitalRaidSeasonAttacker, + ClanCapitalRaidSeasonAttack, + ClanCapitalRaidSeasonAttackList, + ClanCapitalRaidSeasonDistrict, + ClanCapitalRaidSeasonDistrictList, ClanCapitalRaidSeasonDefenseLogEntry, - ClanCapitalRaidSeasonAttackLogEntry, ClanCapitalRaidSeasonDefenseLogList, - ClanCapitalRaidSeasonAttackLogList, ClanCapitalRaidSeasonMember, - ClanCapitalRaidSeasonMemberList, ClanCapitalRaidSeason, + ClanCapitalRaidSeasonAttackLogEntry, + ClanCapitalRaidSeasonDefenseLogList, + ClanCapitalRaidSeasonAttackLogList, + ClanCapitalRaidSeasonMember, + ClanCapitalRaidSeasonMemberList, + ClanCapitalRaidSeason, ClanCapitalRaidSeasons ) from .clan_capital_ranking_list import ( - ClanCapitalRanking, ClanCapitalRankingList + ClanCapitalRanking, + ClanCapitalRankingList ) from .clan_list import ClanList from .clan_member import ClanMember from .clan_member_list import ClanMemberList -from .clan_ranking_list import ClanRanking, ClanRankingList +from .clan_ranking_list import ( + ClanRanking, + ClanRankingList +) from .clan_war import ClanWar from .clan_war_league_group import ( - ClanWarLeagueRound, ClanWarLeagueRoundList, ClanWarLeagueClanMember, - ClanWarLeagueClanMemberList, ClanWarLeagueClan, ClanWarLeagueClanList, + ClanWarLeagueRound, + ClanWarLeagueRoundList, + ClanWarLeagueClanMember, + ClanWarLeagueClanMemberList, + ClanWarLeagueClan, + ClanWarLeagueClanList, ClanWarLeagueGroup ) -from .clan_war_log import ClanWarLogEntry, ClanWarLog +from .clan_war_log import ( + ClanWarLogEntry, + ClanWarLog +) from .enums import ( - ClanType, WarFrequency, Locations, Leagues, CapitalLeagues, - BuilderBaseLeagues, WarLeagues, Labels, Languages, ClanWarState, - ClanWarLeagueGroupState, ClanWarResult, WarPreference, - PlayerHouseElementType, Village, TokenStatus, ClanRole + ClanType, + WarFrequency, + Locations, + Leagues, + CapitalLeagues, + BuilderBaseLeagues, + WarLeagues, + Labels, + Languages, + ClanWarState, + ClanWarLeagueGroupState, + ClanWarResult, + WarPreference, + PlayerHouseElementType, + Village, + TokenStatus, + ClanRole ) # gold pass season from .gold_pass_season import GoldPassSeason # labels -from .labels import Label, LabelList +from .labels import ( + Label, + LabelList +) from .language import Language # league models from .leagues import ( - League, BuilderBaseLeague, CapitalLeague, WarLeague, LeagueList, - BuilderBaseLeagueList, CapitalLeagueList, WarLeagueList, LeagueSeason, + League, + BuilderBaseLeague, + CapitalLeague, + WarLeague, + LeagueList, + BuilderBaseLeagueList, + CapitalLeagueList, + WarLeagueList, + LeagueSeason, LeagueSeasonList ) # locations -from .location import Location, LocationList +from .location import ( + Location, + LocationList +) # login from .login import * # misc from .misc import * # player models from .player import ( - PlayerClan, LegendLeagueTournamentSeasonResult, PlayerLegendStatistics, - PlayerItemLevel, PlayerItemLevelList, PlayerAchievementProgress, - PlayerAchievementProgressList, Player + PlayerClan, + LegendLeagueTournamentSeasonResult, + PlayerLegendStatistics, + PlayerItemLevel, + PlayerItemLevelList, + PlayerAchievementProgress, + PlayerAchievementProgressList, + Player ) from .player_builder_base_ranking_list import ( - PlayerBuilderBaseRanking, PlayerBuilderBaseRankingList + PlayerBuilderBaseRanking, + PlayerBuilderBaseRankingList ) from .player_house import ( - PlayerHouseElement, PlayerHouseElementList, PlayerHouse + PlayerHouseElement, + PlayerHouseElementList, + PlayerHouse ) from .player_ranking_clan import PlayerRankingClan -from .player_ranking_list import PlayerRanking, PlayerRankingList +from .player_ranking_list import ( + PlayerRanking, + PlayerRankingList +) # miscellaneous from .season import Season from .war_clan import ( - ClanWarAttack, ClanWarAttackList, ClanWarMember, ClanWarMemberList, WarClan + ClanWarAttack, + ClanWarAttackList, + ClanWarMember, + ClanWarMemberList, + WarClan ) + __all__ = ( - "ClanCapital", - "Clan", - "ClanBuilderBaseRanking", - "ClanCapitalRaidSeason", - "ClanCapitalRaidSeasons", - "ClanCapitalRanking", - "ClanMember", - "ClanRanking", - "ClanWar", - "ClanWarLeagueGroup", - "ClanWarLog", - "Label", - "Language", - "League", - "BuilderBaseLeague", - "CapitalLeague", - "WarLeague", - "Location", - "LoginModel", - "Player", - "PlayerBuilderBaseRanking", - "WarClan" + 'Label', + 'Season', + 'WarClan', + 'PlayerRankingClan', + 'PlayerRanking', + 'IterBaseModel', + 'BaseClan', + 'ClanWarAttack', + 'Village', + 'BaseModel', + 'Player', + 'PlayerClan', + 'Location', + 'PlayerHouseElement', + 'Clan', + 'Labels', + 'WarPreference', + 'ClanWarMember', + 'ClanRanking', + 'BuilderBaseLeague', + 'PlayerBuilderBaseRanking', + 'ClanWarMemberList', + 'ClanWarLogEntry', + 'ClanDistrictData', + 'Leagues', + 'PlayerAchievementProgress', + 'PlayerLegendStatistics', + 'Time', + 'WarLeague', + 'After', + 'LeagueList', + 'PlayerItemLevel', + 'LegendLeagueTournamentSeasonResult', + 'TokenStatus', + 'PlayerHouse', + 'PlayerItemLevelList', + 'PlayerAchievementProgressList', + 'PlayerHouseElementList', + 'Before', + 'ClanWarAttackList', + 'CapitalLeagues', + 'Cursor', + 'Paging', + 'League', + 'LeagueSeason', + 'WarLeagueList', + 'Locations', + 'WarLeagues', + 'Languages', + 'WarFrequency', + 'CapitalLeague', + 'ClanWarResult', + 'ClanWarState', + 'BuilderBaseLeagues', + 'PlayerHouseElementType', + 'ClanCapital', + 'CapitalLeagueList', + 'LabelList', + 'ClanRole', + 'BuilderBaseLeagueList', + 'ClanWarLeagueClan', + 'LocationList', + 'ClanWarLeagueClanList', + 'ClanWarLeagueGroupState', + 'ClanCapitalRaidSeason', + 'ClanWarLog', + 'ClanDistrictDataList', + 'ClanWarLeagueRoundList', + 'PlayerRankingList', + 'ClanWarLeagueClanMember', + 'LeagueSeasonList', + 'ClanWarLeagueClanMemberList', + 'ClanCapitalRaidSeasonMemberList', + 'ClanCapitalRaidSeasonDefenseLogList', + 'ClanCapitalRaidSeasonMember', + 'ClanCapitalRaidSeasonDistrictList', + 'ClanCapitalRaidSeasonDistrict', + 'ClanCapitalRaidSeasonDefenseLogEntry', + 'ClanCapitalRaidSeasonAttackLogList', + 'ClanCapitalRaidSeasonAttackLogEntry', + 'ClanCapitalRaidSeasonAttackList', + 'ClanCapitalRaidSeasonAttacker', + 'ClanCapitalRaidSeasonAttack', + 'ClanCapitalRaidSeasons', + 'IconUrl', + 'ClanRankingList', + 'ClanType', + 'PlayerBuilderBaseRankingList', + 'ClanWarLeagueGroup', + 'ClanWar', + 'ClanCapitalRankingList', + 'ClanCapitalRanking', + 'ClanWarLeagueRound', + 'BaseClanMember', + 'ClanBuilderBaseRanking', + 'ClanBuilderBaseRankingList', + 'BadgeUrls', + 'BadgeUrl', + 'IconUrls', + 'ClanCapitalRaidSeasonClanInfo', + 'Language', + 'ClanMember', + 'GoldPassSeason', + 'ClanList', + 'ImageUrl', + 'BaseLeague', + 'ClanMemberList', + 'Auth', + 'Replay', + 'WarStatus', + 'LoginModel', + 'WarStatusList', + 'VerifyTokenRequest', + 'VerifyTokenResponse', + 'Developer', + 'ClientError', + 'ServiceVersion', + 'DeepLinkCreationRequest', + 'DeepLinkCreationResponse', ) diff --git a/pyclasher/api/models/abc.py b/pyclasher/api/models/abc.py index 02fd0a7..be06725 100644 --- a/pyclasher/api/models/abc.py +++ b/pyclasher/api/models/abc.py @@ -4,6 +4,12 @@ from ...exceptions import RequestNotDone, MISSING +__all__ = ( + 'BaseModel', + 'IterBaseModel' +) + + class BaseModel(ABC): def __new__(cls, data=None): if data is MISSING: diff --git a/pyclasher/api/models/abc.pyi b/pyclasher/api/models/abc.pyi index 42f6b8c..9c8a0be 100644 --- a/pyclasher/api/models/abc.pyi +++ b/pyclasher/api/models/abc.pyi @@ -8,6 +8,12 @@ from typing import Any, Generator, Iterator from ...exceptions import MISSING, Missing +__all__ = ( + 'BaseModel', + 'IterBaseModel' +) + + class BaseModel: """ base model diff --git a/pyclasher/api/models/base_models.py b/pyclasher/api/models/base_models.py index 01db6d8..d1bf931 100644 --- a/pyclasher/api/models/base_models.py +++ b/pyclasher/api/models/base_models.py @@ -6,6 +6,23 @@ from ...exceptions import InvalidTimeFormat, MISSING +__all__ = ( + 'ImageUrl', + 'IconUrl', + 'IconUrls', + 'After', + 'Before', + 'Cursor', + 'Paging', + 'BadgeUrl', + 'BadgeUrls', + 'Time', + 'BaseLeague', + 'BaseClanMember', + 'BaseClan' +) + + class ImageUrl: def __init__(self, url): self.__url = url diff --git a/pyclasher/api/models/base_models.pyi b/pyclasher/api/models/base_models.pyi index d9d4369..00183b5 100644 --- a/pyclasher/api/models/base_models.pyi +++ b/pyclasher/api/models/base_models.pyi @@ -7,6 +7,23 @@ from .abc import BaseModel from ...exceptions import MISSING, Missing +__all__ = ( + 'ImageUrl', + 'IconUrl', + 'IconUrls', + 'After', + 'Before', + 'Cursor', + 'Paging', + 'BadgeUrl', + 'BadgeUrls', + 'Time', + 'BaseLeague', + 'BaseClanMember', + 'BaseClan' +) + + class ImageUrl: """ image URL model diff --git a/pyclasher/api/models/clan.py b/pyclasher/api/models/clan.py index 8c859f3..22fee91 100644 --- a/pyclasher/api/models/clan.py +++ b/pyclasher/api/models/clan.py @@ -8,6 +8,14 @@ from .location import Location +__all__ = ( + 'Clan', + 'ClanCapital', + 'ClanDistrictData', + 'ClanDistrictDataList', +) + + class ClanDistrictData(BaseModel): def __init__(self, data): super().__init__(data) diff --git a/pyclasher/api/models/clan.pyi b/pyclasher/api/models/clan.pyi index e87bc6d..87616ec 100644 --- a/pyclasher/api/models/clan.pyi +++ b/pyclasher/api/models/clan.pyi @@ -14,6 +14,14 @@ from .location import Location from ...exceptions import Missing +__all__ = ( + 'Clan', + 'ClanCapital', + 'ClanDistrictData', + 'ClanDistrictDataList', +) + + class ClanDistrictData(BaseModel): """ clan district data model diff --git a/pyclasher/api/models/clan_builder_base_ranking_list.py b/pyclasher/api/models/clan_builder_base_ranking_list.py index 55e4e4c..0244411 100644 --- a/pyclasher/api/models/clan_builder_base_ranking_list.py +++ b/pyclasher/api/models/clan_builder_base_ranking_list.py @@ -1,6 +1,12 @@ from .abc import BaseModel, IterBaseModel +__all__ = ( + 'ClanBuilderBaseRankingList', + 'ClanBuilderBaseRanking', +) + + class ClanBuilderBaseRanking(BaseModel): @property def clan_points(self): diff --git a/pyclasher/api/models/clan_builder_base_ranking_list.pyi b/pyclasher/api/models/clan_builder_base_ranking_list.pyi index e4da8b8..2b07dd3 100644 --- a/pyclasher/api/models/clan_builder_base_ranking_list.pyi +++ b/pyclasher/api/models/clan_builder_base_ranking_list.pyi @@ -3,6 +3,12 @@ from typing import Iterator from .abc import BaseModel, IterBaseModel +__all__ = ( + 'ClanBuilderBaseRankingList', + 'ClanBuilderBaseRanking', +) + + class ClanBuilderBaseRanking(BaseModel): """ clan builder base ranking model diff --git a/pyclasher/api/models/clan_capital_raid_seasons.py b/pyclasher/api/models/clan_capital_raid_seasons.py index be4c8f8..d556a34 100644 --- a/pyclasher/api/models/clan_capital_raid_seasons.py +++ b/pyclasher/api/models/clan_capital_raid_seasons.py @@ -2,6 +2,24 @@ from .base_models import BadgeUrls, BaseClanMember, Time +__all__ = ( + 'ClanCapitalRaidSeason', + 'ClanCapitalRaidSeasonClanInfo', + 'ClanCapitalRaidSeasonAttack', + 'ClanCapitalRaidSeasonAttacker', + 'ClanCapitalRaidSeasonAttackList', + 'ClanCapitalRaidSeasonAttackLogEntry', + 'ClanCapitalRaidSeasonAttackLogList', + 'ClanCapitalRaidSeasonDefenseLogEntry', + 'ClanCapitalRaidSeasonDefenseLogList', + 'ClanCapitalRaidSeasonDistrict', + 'ClanCapitalRaidSeasonDistrictList', + 'ClanCapitalRaidSeasonMember', + 'ClanCapitalRaidSeasonMemberList', + 'ClanCapitalRaidSeasons', +) + + class ClanCapitalRaidSeasonClanInfo(BaseModel): def __init__(self, data): super().__init__(data) diff --git a/pyclasher/api/models/clan_capital_raid_seasons.pyi b/pyclasher/api/models/clan_capital_raid_seasons.pyi index b175771..985d328 100644 --- a/pyclasher/api/models/clan_capital_raid_seasons.pyi +++ b/pyclasher/api/models/clan_capital_raid_seasons.pyi @@ -5,6 +5,24 @@ from .base_models import BaseClanMember, BaseClan, Time from ...exceptions import Missing +__all__ = ( + 'ClanCapitalRaidSeason', + 'ClanCapitalRaidSeasonClanInfo', + 'ClanCapitalRaidSeasonAttack', + 'ClanCapitalRaidSeasonAttacker', + 'ClanCapitalRaidSeasonAttackList', + 'ClanCapitalRaidSeasonAttackLogEntry', + 'ClanCapitalRaidSeasonAttackLogList', + 'ClanCapitalRaidSeasonDefenseLogEntry', + 'ClanCapitalRaidSeasonDefenseLogList', + 'ClanCapitalRaidSeasonDistrict', + 'ClanCapitalRaidSeasonDistrictList', + 'ClanCapitalRaidSeasonMember', + 'ClanCapitalRaidSeasonMemberList', + 'ClanCapitalRaidSeasons', +) + + class ClanCapitalRaidSeasonClanInfo(BaseClan): """ clan capital raid season clan info model diff --git a/pyclasher/api/models/clan_capital_ranking_list.py b/pyclasher/api/models/clan_capital_ranking_list.py index 09d1d7b..60b7a5a 100644 --- a/pyclasher/api/models/clan_capital_ranking_list.py +++ b/pyclasher/api/models/clan_capital_ranking_list.py @@ -1,6 +1,12 @@ from .abc import BaseModel, IterBaseModel +__all__ = ( + 'ClanCapitalRankingList', + 'ClanCapitalRanking', +) + + class ClanCapitalRanking(BaseModel): @property def clan_points(self): diff --git a/pyclasher/api/models/clan_capital_ranking_list.pyi b/pyclasher/api/models/clan_capital_ranking_list.pyi index 8060f41..a9a9475 100644 --- a/pyclasher/api/models/clan_capital_ranking_list.pyi +++ b/pyclasher/api/models/clan_capital_ranking_list.pyi @@ -3,6 +3,12 @@ from typing import Iterator from .abc import BaseModel, IterBaseModel +__all__ = ( + 'ClanCapitalRankingList', + 'ClanCapitalRanking', +) + + class ClanCapitalRanking(BaseModel): """ clan capital ranking model diff --git a/pyclasher/api/models/clan_list.py b/pyclasher/api/models/clan_list.py index 5d020c8..c7486f3 100644 --- a/pyclasher/api/models/clan_list.py +++ b/pyclasher/api/models/clan_list.py @@ -2,6 +2,11 @@ from .clan import Clan +__all__ = ( + 'ClanList1', +) + + class ClanList(IterBaseModel): _iter_rtype = Clan diff --git a/pyclasher/api/models/clan_list.pyi b/pyclasher/api/models/clan_list.pyi index 54c0ced..e7ab94e 100644 --- a/pyclasher/api/models/clan_list.pyi +++ b/pyclasher/api/models/clan_list.pyi @@ -4,6 +4,11 @@ from .abc import IterBaseModel from .clan import Clan +__all__ = ( + 'ClanList1', +) + + class ClanList(IterBaseModel): """ clan list model diff --git a/pyclasher/api/models/clan_member.py b/pyclasher/api/models/clan_member.py index 4b018f7..a840dec 100644 --- a/pyclasher/api/models/clan_member.py +++ b/pyclasher/api/models/clan_member.py @@ -4,6 +4,11 @@ from .player_house import PlayerHouse +__all__ = ( + 'ClanMember', +) + + class ClanMember(BaseClanMember): @property def league(self): diff --git a/pyclasher/api/models/clan_member.pyi b/pyclasher/api/models/clan_member.pyi index bf47c3e..b7fc662 100644 --- a/pyclasher/api/models/clan_member.pyi +++ b/pyclasher/api/models/clan_member.pyi @@ -5,6 +5,11 @@ from .player_house import PlayerHouse from ...exceptions import Missing +__all__ = ( + 'ClanMember', +) + + class ClanMember(BaseClanMember): """ clan member model diff --git a/pyclasher/api/models/clan_member_list.py b/pyclasher/api/models/clan_member_list.py index 3da7836..3830e69 100644 --- a/pyclasher/api/models/clan_member_list.py +++ b/pyclasher/api/models/clan_member_list.py @@ -2,6 +2,11 @@ from .clan_member import ClanMember +__all__ = ( + 'ClanMemberList', +) + + class ClanMemberList(IterBaseModel): _iter_rtype = ClanMember diff --git a/pyclasher/api/models/clan_member_list.pyi b/pyclasher/api/models/clan_member_list.pyi index 67189bf..16c09a2 100644 --- a/pyclasher/api/models/clan_member_list.pyi +++ b/pyclasher/api/models/clan_member_list.pyi @@ -4,6 +4,11 @@ from .abc import IterBaseModel from .clan_member import ClanMember +__all__ = ( + 'ClanMemberList', +) + + class ClanMemberList(IterBaseModel): """ clan member list model diff --git a/pyclasher/api/models/clan_ranking_list.py b/pyclasher/api/models/clan_ranking_list.py index 55a5e52..66701e9 100644 --- a/pyclasher/api/models/clan_ranking_list.py +++ b/pyclasher/api/models/clan_ranking_list.py @@ -3,6 +3,12 @@ from .location import Location +__all__ = ( + 'ClanRanking', + 'ClanRankingList', +) + + class ClanRanking(BaseModel): @property def clan_level(self): diff --git a/pyclasher/api/models/clan_ranking_list.pyi b/pyclasher/api/models/clan_ranking_list.pyi index 3bf2674..4d91294 100644 --- a/pyclasher/api/models/clan_ranking_list.pyi +++ b/pyclasher/api/models/clan_ranking_list.pyi @@ -5,6 +5,12 @@ from .base_models import BadgeUrls from .location import Location +__all__ = ( + 'ClanRanking', + 'ClanRankingList', +) + + class ClanRanking(BaseModel): """ clan ranking model diff --git a/pyclasher/api/models/clan_war.py b/pyclasher/api/models/clan_war.py index e27fca4..2c5c1eb 100644 --- a/pyclasher/api/models/clan_war.py +++ b/pyclasher/api/models/clan_war.py @@ -4,6 +4,11 @@ from .war_clan import WarClan +__all__ = ( + 'ClanWar', +) + + class ClanWar(BaseModel): @property def clan(self): diff --git a/pyclasher/api/models/clan_war.pyi b/pyclasher/api/models/clan_war.pyi index 3eae489..bf2c42c 100644 --- a/pyclasher/api/models/clan_war.pyi +++ b/pyclasher/api/models/clan_war.pyi @@ -4,6 +4,11 @@ from .enums import ClanWarState from .war_clan import WarClan +__all__ = ( + 'ClanWar', +) + + class ClanWar(BaseModel): @property def clan(self) -> WarClan: diff --git a/pyclasher/api/models/clan_war_league_group.py b/pyclasher/api/models/clan_war_league_group.py index f184978..baf70cd 100644 --- a/pyclasher/api/models/clan_war_league_group.py +++ b/pyclasher/api/models/clan_war_league_group.py @@ -3,6 +3,17 @@ from .enums import ClanWarLeagueGroupState +__all__ = ( + 'ClanWarLeagueRound', + 'ClanWarLeagueClan', + 'ClanWarLeagueGroup', + 'ClanWarLeagueClanList', + 'ClanWarLeagueClanMember', + 'ClanWarLeagueClanMemberList', + 'ClanWarLeagueRoundList', +) + + class ClanWarLeagueRound(BaseModel): @property def war_tags(self): diff --git a/pyclasher/api/models/clan_war_league_group.pyi b/pyclasher/api/models/clan_war_league_group.pyi index 24985f2..c132930 100644 --- a/pyclasher/api/models/clan_war_league_group.pyi +++ b/pyclasher/api/models/clan_war_league_group.pyi @@ -5,6 +5,17 @@ from .base_models import BaseClanMember, BaseClan from .enums import ClanWarLeagueGroupState +__all__ = ( + 'ClanWarLeagueRound', + 'ClanWarLeagueClan', + 'ClanWarLeagueGroup', + 'ClanWarLeagueClanList', + 'ClanWarLeagueClanMember', + 'ClanWarLeagueClanMemberList', + 'ClanWarLeagueRoundList', +) + + class ClanWarLeagueRound(BaseModel): """ clan war league round model diff --git a/pyclasher/api/models/clan_war_log.py b/pyclasher/api/models/clan_war_log.py index 743d693..b27e010 100644 --- a/pyclasher/api/models/clan_war_log.py +++ b/pyclasher/api/models/clan_war_log.py @@ -8,6 +8,12 @@ from ...utils.functions import snake_to_camel +__all__ = ( + 'ClanWarLog', + 'ClanWarLogEntry', +) + + class ClanWarLogEntry(BaseModel): @property def clan(self): diff --git a/pyclasher/api/models/clan_war_log.pyi b/pyclasher/api/models/clan_war_log.pyi index 07f914c..258ca85 100644 --- a/pyclasher/api/models/clan_war_log.pyi +++ b/pyclasher/api/models/clan_war_log.pyi @@ -6,6 +6,12 @@ from .enums import ClanWarResult from .war_clan import WarClan +__all__ = ( + 'ClanWarLog', + 'ClanWarLogEntry', +) + + class ClanWarLogEntry(BaseModel): """ clan war log entry model diff --git a/pyclasher/api/models/enums.py b/pyclasher/api/models/enums.py index 648df66..977cea2 100644 --- a/pyclasher/api/models/enums.py +++ b/pyclasher/api/models/enums.py @@ -5,6 +5,27 @@ from .location import Location +__all__ = ( + 'ClanWarState', + 'ClanType', + 'Labels', + 'BuilderBaseLeagues', + 'CapitalLeagues', + 'ClanRole', + 'ClanWarLeagueGroupState', + 'ClanWarResult', + 'Languages', + 'Leagues', + 'Village', + 'Locations', + 'PlayerHouseElementType', + 'WarLeagues', + 'TokenStatus', + 'WarFrequency', + 'WarPreference', +) + + class ClanType(Enum): CLOSED = "closed" INVITE_ONLY = "inviteOnly" diff --git a/pyclasher/api/models/enums.pyi b/pyclasher/api/models/enums.pyi index f58b5df..68e6ff2 100644 --- a/pyclasher/api/models/enums.pyi +++ b/pyclasher/api/models/enums.pyi @@ -5,6 +5,27 @@ from .leagues import League, CapitalLeague, BuilderBaseLeague, WarLeague from .location import Location +__all__ = ( + 'ClanWarState', + 'ClanType', + 'Labels', + 'BuilderBaseLeagues', + 'CapitalLeagues', + 'ClanRole', + 'ClanWarLeagueGroupState', + 'ClanWarResult', + 'Languages', + 'Leagues', + 'Village', + 'Locations', + 'PlayerHouseElementType', + 'WarLeagues', + 'TokenStatus', + 'WarFrequency', + 'WarPreference', +) + + class ClanType(Enum): CLOSED = "closed" INVITE_ONLY = "inviteOnly" diff --git a/pyclasher/api/models/gold_pass_season.py b/pyclasher/api/models/gold_pass_season.py index a104814..1a5dc95 100644 --- a/pyclasher/api/models/gold_pass_season.py +++ b/pyclasher/api/models/gold_pass_season.py @@ -2,6 +2,11 @@ from .base_models import Time +__all__ = ( + 'GoldPassSeason', +) + + class GoldPassSeason(BaseModel): @property def start_time(self): diff --git a/pyclasher/api/models/gold_pass_season.pyi b/pyclasher/api/models/gold_pass_season.pyi index d270a6d..184e77f 100644 --- a/pyclasher/api/models/gold_pass_season.pyi +++ b/pyclasher/api/models/gold_pass_season.pyi @@ -2,6 +2,11 @@ from .abc import BaseModel from .base_models import Time +__all__ = ( + 'GoldPassSeason', +) + + class GoldPassSeason(BaseModel): """ gold pass season model diff --git a/pyclasher/api/models/labels.py b/pyclasher/api/models/labels.py index 56dc42c..14003e5 100644 --- a/pyclasher/api/models/labels.py +++ b/pyclasher/api/models/labels.py @@ -2,6 +2,12 @@ from .base_models import IconUrls +__all__ = ( + 'Label', + 'LabelList', +) + + class Label(BaseModel): def __init__(self, data): super().__init__(data) diff --git a/pyclasher/api/models/labels.pyi b/pyclasher/api/models/labels.pyi index 18ed62e..70ca1dc 100644 --- a/pyclasher/api/models/labels.pyi +++ b/pyclasher/api/models/labels.pyi @@ -4,6 +4,12 @@ from .abc import BaseModel, IterBaseModel from .base_models import IconUrls +__all__ = ( + 'Label', + 'LabelList', +) + + class Label(BaseModel): @property def name(self) -> str: diff --git a/pyclasher/api/models/language.py b/pyclasher/api/models/language.py index d657aff..a9cff29 100644 --- a/pyclasher/api/models/language.py +++ b/pyclasher/api/models/language.py @@ -1,6 +1,11 @@ from .abc import BaseModel +__all__ = ( + 'Language', +) + + class Language(BaseModel): def __init__(self, data: dict): super().__init__(data) diff --git a/pyclasher/api/models/language.pyi b/pyclasher/api/models/language.pyi index 46ae7e6..b0e27a3 100644 --- a/pyclasher/api/models/language.pyi +++ b/pyclasher/api/models/language.pyi @@ -1,6 +1,11 @@ from .abc import BaseModel +__all__ = ( + 'Language', +) + + class Language(BaseModel): """ language model diff --git a/pyclasher/api/models/leagues.py b/pyclasher/api/models/leagues.py index 1470d43..f9ef66d 100644 --- a/pyclasher/api/models/leagues.py +++ b/pyclasher/api/models/leagues.py @@ -2,6 +2,20 @@ from .base_models import IconUrls, BaseLeague +__all__ = ( + 'League', + 'LeagueList', + 'BuilderBaseLeague', + 'BuilderBaseLeagueList', + 'CapitalLeague', + 'CapitalLeagueList', + 'LeagueSeason', + 'LeagueSeasonList', + 'WarLeague', + 'WarLeagueList', +) + + class League(BaseLeague): @property def icon_urls(self): diff --git a/pyclasher/api/models/leagues.pyi b/pyclasher/api/models/leagues.pyi index 210452f..89a7be1 100644 --- a/pyclasher/api/models/leagues.pyi +++ b/pyclasher/api/models/leagues.pyi @@ -7,6 +7,20 @@ from .abc import BaseModel, IterBaseModel from .base_models import IconUrls, BaseLeague +__all__ = ( + 'League', + 'LeagueList', + 'BuilderBaseLeague', + 'BuilderBaseLeagueList', + 'CapitalLeague', + 'CapitalLeagueList', + 'LeagueSeason', + 'LeagueSeasonList', + 'WarLeague', + 'WarLeagueList', +) + + class League(BaseLeague): """ league model diff --git a/pyclasher/api/models/location.py b/pyclasher/api/models/location.py index f03eb25..2b8d11f 100644 --- a/pyclasher/api/models/location.py +++ b/pyclasher/api/models/location.py @@ -1,6 +1,12 @@ from .abc import IterBaseModel, BaseModel +__all__ = ( + 'Location', + 'LocationList', +) + + class Location(BaseModel): def __init__(self, data): super().__init__(data) diff --git a/pyclasher/api/models/location.pyi b/pyclasher/api/models/location.pyi index 8daa1f6..c021a06 100644 --- a/pyclasher/api/models/location.pyi +++ b/pyclasher/api/models/location.pyi @@ -7,6 +7,12 @@ from .abc import IterBaseModel, BaseModel from ...exceptions import Missing +__all__ = ( + 'Location', + 'LocationList', +) + + class Location(BaseModel): """ location model diff --git a/pyclasher/api/models/player.py b/pyclasher/api/models/player.py index 4ba54ca..1273d35 100644 --- a/pyclasher/api/models/player.py +++ b/pyclasher/api/models/player.py @@ -6,6 +6,18 @@ from .player_house import PlayerHouse +__all__ = ( + 'LegendLeagueTournamentSeasonResult', + 'Player', + 'PlayerAchievementProgress', + 'PlayerAchievementProgressList', + 'PlayerClan', + 'PlayerItemLevel', + 'PlayerItemLevelList', + 'PlayerLegendStatistics', +) + + class PlayerClan(BaseClan): @property def clan_level(self): diff --git a/pyclasher/api/models/player.pyi b/pyclasher/api/models/player.pyi index 474968d..00de72d 100644 --- a/pyclasher/api/models/player.pyi +++ b/pyclasher/api/models/player.pyi @@ -9,6 +9,18 @@ from .player_house import PlayerHouse from ...exceptions import Missing +__all__ = ( + 'LegendLeagueTournamentSeasonResult', + 'Player', + 'PlayerAchievementProgress', + 'PlayerAchievementProgressList', + 'PlayerClan', + 'PlayerItemLevel', + 'PlayerItemLevelList', + 'PlayerLegendStatistics', +) + + class PlayerClan(BaseClan): """ player clan model diff --git a/pyclasher/api/models/player_builder_base_ranking_list.py b/pyclasher/api/models/player_builder_base_ranking_list.py index fec733d..c032a6a 100644 --- a/pyclasher/api/models/player_builder_base_ranking_list.py +++ b/pyclasher/api/models/player_builder_base_ranking_list.py @@ -3,6 +3,12 @@ from .player_ranking_clan import PlayerRankingClan +__all__ = ( + 'PlayerBuilderBaseRanking', + 'PlayerBuilderBaseRankingList', +) + + class PlayerBuilderBaseRanking(BaseModel): @property def builder_base_league(self): diff --git a/pyclasher/api/models/player_builder_base_ranking_list.pyi b/pyclasher/api/models/player_builder_base_ranking_list.pyi index b5bcd31..dcc1dfa 100644 --- a/pyclasher/api/models/player_builder_base_ranking_list.pyi +++ b/pyclasher/api/models/player_builder_base_ranking_list.pyi @@ -5,6 +5,12 @@ from .leagues import BuilderBaseLeague from .player_ranking_clan import PlayerRankingClan +__all__ = ( + 'PlayerBuilderBaseRanking', + 'PlayerBuilderBaseRankingList', +) + + class PlayerBuilderBaseRanking(BaseModel): @property def builder_base_league(self) -> BuilderBaseLeague: diff --git a/pyclasher/api/models/player_house.py b/pyclasher/api/models/player_house.py index dd64cb2..720190b 100644 --- a/pyclasher/api/models/player_house.py +++ b/pyclasher/api/models/player_house.py @@ -2,6 +2,13 @@ from .enums import PlayerHouseElementType +__all__ = ( + 'PlayerHouse', + 'PlayerHouseElement', + 'PlayerHouseElementList', +) + + class PlayerHouseElement(BaseModel): def __init__(self, data): super().__init__(data) diff --git a/pyclasher/api/models/player_house.pyi b/pyclasher/api/models/player_house.pyi index f4de64c..456b6d9 100644 --- a/pyclasher/api/models/player_house.pyi +++ b/pyclasher/api/models/player_house.pyi @@ -4,6 +4,13 @@ from .abc import BaseModel, IterBaseModel from .enums import PlayerHouseElementType +__all__ = ( + 'PlayerHouse', + 'PlayerHouseElement', + 'PlayerHouseElementList', +) + + class PlayerHouseElement(BaseModel): @property def id(self) -> int: diff --git a/pyclasher/api/models/player_ranking_clan.py b/pyclasher/api/models/player_ranking_clan.py index 77483c5..20eb526 100644 --- a/pyclasher/api/models/player_ranking_clan.py +++ b/pyclasher/api/models/player_ranking_clan.py @@ -1,5 +1,10 @@ from .base_models import BaseClan +__all__ = ( + 'PlayerRankingClan', +) + + class PlayerRankingClan(BaseClan): pass diff --git a/pyclasher/api/models/player_ranking_list.py b/pyclasher/api/models/player_ranking_list.py index a6e99c9..d71b9f3 100644 --- a/pyclasher/api/models/player_ranking_list.py +++ b/pyclasher/api/models/player_ranking_list.py @@ -3,6 +3,12 @@ from .player_ranking_clan import PlayerRankingClan +__all__ = ( + 'PlayerRanking', + 'PlayerRankingList', +) + + class PlayerRanking(BaseModel): @property def league(self): diff --git a/pyclasher/api/models/player_ranking_list.pyi b/pyclasher/api/models/player_ranking_list.pyi index f672279..49a8e48 100644 --- a/pyclasher/api/models/player_ranking_list.pyi +++ b/pyclasher/api/models/player_ranking_list.pyi @@ -5,6 +5,12 @@ from .leagues import League from .player_ranking_clan import PlayerRankingClan +__all__ = ( + 'PlayerRanking', + 'PlayerRankingList', +) + + class PlayerRanking(BaseModel): @property def league(self) -> League: diff --git a/pyclasher/api/models/season.py b/pyclasher/api/models/season.py index c38ca5f..1e310d4 100644 --- a/pyclasher/api/models/season.py +++ b/pyclasher/api/models/season.py @@ -1,6 +1,11 @@ from ...exceptions import InvalidSeasonFormat +__all__ = ( + 'Season', +) + + class Season: def __init__(self, year, month): self.year = year diff --git a/pyclasher/api/models/season.pyi b/pyclasher/api/models/season.pyi index b21b05e..58f4bba 100644 --- a/pyclasher/api/models/season.pyi +++ b/pyclasher/api/models/season.pyi @@ -1,3 +1,8 @@ +__all__ = ( + 'Season', +) + + class Season: def __init__(self, year: int, month: int): self.year = year diff --git a/pyclasher/api/models/war_clan.py b/pyclasher/api/models/war_clan.py index fd9a037..280f226 100644 --- a/pyclasher/api/models/war_clan.py +++ b/pyclasher/api/models/war_clan.py @@ -2,6 +2,15 @@ from .base_models import BaseClanMember, BaseClan +__all__ = ( + 'ClanWarAttack', + 'ClanWarAttackList', + 'ClanWarMember', + 'ClanWarMemberList', + 'WarClan', +) + + class ClanWarAttack(BaseModel): def __init__(self, data): super().__init__(data) diff --git a/pyclasher/api/models/war_clan.pyi b/pyclasher/api/models/war_clan.pyi index 8a40ff7..63aa94b 100644 --- a/pyclasher/api/models/war_clan.pyi +++ b/pyclasher/api/models/war_clan.pyi @@ -4,6 +4,15 @@ from .abc import BaseModel, IterBaseModel from .base_models import BaseClanMember, BaseClan +__all__ = ( + 'ClanWarAttack', + 'ClanWarAttackList', + 'ClanWarMember', + 'ClanWarMemberList', + 'WarClan', +) + + class ClanWarAttack(BaseModel): @property def order(self) -> int: From 22488a959ff143c82d40e0bb8cdf7d5075bd3478 Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Sun, 1 Oct 2023 21:51:30 +0200 Subject: [PATCH 07/12] rebase: api requests import --- pyclasher/api/requests/abc.py | 7 +++++++ pyclasher/api/requests/abc.pyi | 7 +++++++ pyclasher/api/requests/builder_base_league.py | 5 +++++ pyclasher/api/requests/builder_base_league.pyi | 5 +++++ pyclasher/api/requests/builder_base_leagues.py | 5 +++++ pyclasher/api/requests/builder_base_leagues.pyi | 5 +++++ pyclasher/api/requests/capital_league.py | 5 +++++ pyclasher/api/requests/capital_league.pyi | 5 +++++ pyclasher/api/requests/capital_league_seasons.py | 5 +++++ pyclasher/api/requests/capital_league_seasons.pyi | 5 +++++ pyclasher/api/requests/capital_rankings.py | 5 +++++ pyclasher/api/requests/capital_rankings.pyi | 5 +++++ pyclasher/api/requests/clan.py | 5 +++++ pyclasher/api/requests/clan.pyi | 5 +++++ pyclasher/api/requests/clan_builder_base_rankings.py | 5 +++++ pyclasher/api/requests/clan_builder_base_rankings.pyi | 5 +++++ pyclasher/api/requests/clan_capital_raid_seasons.py | 4 ++++ pyclasher/api/requests/clan_capital_raid_seasons.pyi | 5 +++++ pyclasher/api/requests/clan_current_war.py | 5 +++++ pyclasher/api/requests/clan_current_war.pyi | 5 +++++ pyclasher/api/requests/clan_currentwar_leaguegroup.py | 5 +++++ pyclasher/api/requests/clan_currentwar_leaguegroup.pyi | 5 +++++ pyclasher/api/requests/clan_labels.py | 5 +++++ pyclasher/api/requests/clan_labels.pyi | 5 +++++ pyclasher/api/requests/clan_members.py | 5 +++++ pyclasher/api/requests/clan_members.pyi | 5 +++++ pyclasher/api/requests/clan_rankings.py | 5 +++++ pyclasher/api/requests/clan_rankings.pyi | 5 +++++ pyclasher/api/requests/clan_search.py | 5 +++++ pyclasher/api/requests/clan_search.pyi | 5 +++++ pyclasher/api/requests/clan_war_log.py | 5 +++++ pyclasher/api/requests/clan_war_log.pyi | 5 +++++ pyclasher/api/requests/clan_warleagues_wars.py | 5 +++++ pyclasher/api/requests/clan_warleagues_wars.pyi | 5 +++++ pyclasher/api/requests/gold_pass.py | 5 +++++ pyclasher/api/requests/gold_pass.pyi | 5 +++++ pyclasher/api/requests/league.py | 5 +++++ pyclasher/api/requests/league.pyi | 5 +++++ pyclasher/api/requests/league_season.py | 5 +++++ pyclasher/api/requests/league_season.pyi | 5 +++++ pyclasher/api/requests/league_seasons.py | 5 +++++ pyclasher/api/requests/league_seasons.pyi | 5 +++++ pyclasher/api/requests/leagues.py | 5 +++++ pyclasher/api/requests/leagues.pyi | 5 +++++ pyclasher/api/requests/location.py | 5 +++++ pyclasher/api/requests/location.pyi | 5 +++++ pyclasher/api/requests/locations.py | 5 +++++ pyclasher/api/requests/locations.pyi | 5 +++++ pyclasher/api/requests/player.py | 5 +++++ pyclasher/api/requests/player.pyi | 5 +++++ pyclasher/api/requests/player_builder_base_rankings.py | 5 +++++ pyclasher/api/requests/player_builder_base_rankings.pyi | 5 +++++ pyclasher/api/requests/player_labels.py | 5 +++++ pyclasher/api/requests/player_labels.pyi | 5 +++++ pyclasher/api/requests/player_rankings.py | 5 +++++ pyclasher/api/requests/player_rankings.pyi | 5 +++++ pyclasher/api/requests/war_league.py | 5 +++++ pyclasher/api/requests/war_league.pyi | 5 +++++ pyclasher/api/requests/war_leagues.py | 5 +++++ pyclasher/api/requests/war_leagues.pyi | 5 +++++ 60 files changed, 303 insertions(+) diff --git a/pyclasher/api/requests/abc.py b/pyclasher/api/requests/abc.py index 52d2a2a..373efd0 100644 --- a/pyclasher/api/requests/abc.py +++ b/pyclasher/api/requests/abc.py @@ -8,6 +8,13 @@ MISSING, InvalidClientId) from ...utils.request_methods import RequestMethods + +__all__ = ( + 'RequestModel', + 'IterRequestModel', +) + + request_id = 0 diff --git a/pyclasher/api/requests/abc.pyi b/pyclasher/api/requests/abc.pyi index 27f5939..9ea5c81 100644 --- a/pyclasher/api/requests/abc.pyi +++ b/pyclasher/api/requests/abc.pyi @@ -6,6 +6,13 @@ from ...client import Client from ...exceptions import MISSING, Missing from ...utils import RequestMethods + +__all__ = ( + 'RequestModel', + 'IterRequestModel', +) + + request_id: int = 0 diff --git a/pyclasher/api/requests/builder_base_league.py b/pyclasher/api/requests/builder_base_league.py index a141ce7..587ea83 100644 --- a/pyclasher/api/requests/builder_base_league.py +++ b/pyclasher/api/requests/builder_base_league.py @@ -2,6 +2,11 @@ from ..models import BuilderBaseLeague +__all__ = ( + 'BuilderBaseLeagueRequest', +) + + class BuilderBaseLeagueRequest(RequestModel, BuilderBaseLeague): def __init__(self, league_id): RequestModel.__init__(self, diff --git a/pyclasher/api/requests/builder_base_league.pyi b/pyclasher/api/requests/builder_base_league.pyi index c858ea4..15ae8f3 100644 --- a/pyclasher/api/requests/builder_base_league.pyi +++ b/pyclasher/api/requests/builder_base_league.pyi @@ -2,6 +2,11 @@ from .abc import RequestModel from ..models import BuilderBaseLeague +__all__ = ( + 'BuilderBaseLeagueRequest', +) + + class BuilderBaseLeagueRequest(RequestModel, BuilderBaseLeague): def __init__(self, league_id: int): self.league_id = league_id diff --git a/pyclasher/api/requests/builder_base_leagues.py b/pyclasher/api/requests/builder_base_leagues.py index 13d1921..c921b77 100644 --- a/pyclasher/api/requests/builder_base_leagues.py +++ b/pyclasher/api/requests/builder_base_leagues.py @@ -2,6 +2,11 @@ from ..models import BuilderBaseLeagueList, BuilderBaseLeague +__all__ = ( + 'BuilderBaseLeaguesRequest', +) + + class BuilderBaseLeaguesRequest(IterRequestModel): _iter_rtype = BuilderBaseLeague _list_rtype = BuilderBaseLeagueList diff --git a/pyclasher/api/requests/builder_base_leagues.pyi b/pyclasher/api/requests/builder_base_leagues.pyi index 8c438cf..ce73f49 100644 --- a/pyclasher/api/requests/builder_base_leagues.pyi +++ b/pyclasher/api/requests/builder_base_leagues.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import BuilderBaseLeagueList, BuilderBaseLeague +__all__ = ( + 'BuilderBaseLeaguesRequest', +) + + class BuilderBaseLeaguesRequest(IterRequestModel): _iter_rtype = BuilderBaseLeague _list_rtype = BuilderBaseLeagueList diff --git a/pyclasher/api/requests/capital_league.py b/pyclasher/api/requests/capital_league.py index a4fc524..85afb34 100644 --- a/pyclasher/api/requests/capital_league.py +++ b/pyclasher/api/requests/capital_league.py @@ -2,6 +2,11 @@ from ..models import CapitalLeague +__all__ = ( + 'CapitalLeagueRequest', +) + + class CapitalLeagueRequest(RequestModel, CapitalLeague): def __init__(self, league_id): RequestModel.__init__(self, "capitalleagues/{league_id}", diff --git a/pyclasher/api/requests/capital_league.pyi b/pyclasher/api/requests/capital_league.pyi index 207c73b..28d80f7 100644 --- a/pyclasher/api/requests/capital_league.pyi +++ b/pyclasher/api/requests/capital_league.pyi @@ -2,6 +2,11 @@ from .abc import RequestModel from ..models import CapitalLeague +__all__ = ( + 'CapitalLeagueRequest', +) + + class CapitalLeagueRequest(RequestModel, CapitalLeague): def __init__(self, league_id: int): self.league_id = league_id diff --git a/pyclasher/api/requests/capital_league_seasons.py b/pyclasher/api/requests/capital_league_seasons.py index 8ea1025..aa497af 100644 --- a/pyclasher/api/requests/capital_league_seasons.py +++ b/pyclasher/api/requests/capital_league_seasons.py @@ -2,6 +2,11 @@ from ..models import CapitalLeagueList, CapitalLeague +__all__ = ( + 'CapitalLeaguesRequest', +) + + class CapitalLeaguesRequest(IterRequestModel): _iter_rtype = CapitalLeague _list_rtype = CapitalLeagueList diff --git a/pyclasher/api/requests/capital_league_seasons.pyi b/pyclasher/api/requests/capital_league_seasons.pyi index 3194e6a..65fdefa 100644 --- a/pyclasher/api/requests/capital_league_seasons.pyi +++ b/pyclasher/api/requests/capital_league_seasons.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import CapitalLeagueList, CapitalLeague +__all__ = ( + 'CapitalLeaguesRequest', +) + + class CapitalLeaguesRequest(IterRequestModel): _iter_rtype = CapitalLeague _list_rtype = CapitalLeagueList diff --git a/pyclasher/api/requests/capital_rankings.py b/pyclasher/api/requests/capital_rankings.py index ed5ffcc..a5b4659 100644 --- a/pyclasher/api/requests/capital_rankings.py +++ b/pyclasher/api/requests/capital_rankings.py @@ -2,6 +2,11 @@ from ..models import ClanCapitalRanking, ClanCapitalRankingList, Location +__all__ = ( + 'CapitalRankingsRequest', +) + + class CapitalRankingsRequest(IterRequestModel): _iter_rtype = ClanCapitalRanking _list_rtype = ClanCapitalRankingList diff --git a/pyclasher/api/requests/capital_rankings.pyi b/pyclasher/api/requests/capital_rankings.pyi index 8b13a7e..962ebd0 100644 --- a/pyclasher/api/requests/capital_rankings.pyi +++ b/pyclasher/api/requests/capital_rankings.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import ClanCapitalRanking, ClanCapitalRankingList, Location +__all__ = ( + 'CapitalRankingsRequest', +) + + class CapitalRankingsRequest(IterRequestModel): _iter_rtype = ClanCapitalRanking _list_rtype = ClanCapitalRankingList diff --git a/pyclasher/api/requests/clan.py b/pyclasher/api/requests/clan.py index 28ca197..6a2a758 100644 --- a/pyclasher/api/requests/clan.py +++ b/pyclasher/api/requests/clan.py @@ -2,6 +2,11 @@ from ..models import Clan, BaseClan +__all__ = ( + 'ClanRequest', +) + + class ClanRequest(RequestModel, Clan): """ Get information about a single clan by clan tag. diff --git a/pyclasher/api/requests/clan.pyi b/pyclasher/api/requests/clan.pyi index c93b858..6558976 100644 --- a/pyclasher/api/requests/clan.pyi +++ b/pyclasher/api/requests/clan.pyi @@ -2,6 +2,11 @@ from .abc import RequestModel from ..models import Clan, BaseClan +__all__ = ( + 'ClanRequest', +) + + class ClanRequest(RequestModel, Clan): clan_tag: str = None diff --git a/pyclasher/api/requests/clan_builder_base_rankings.py b/pyclasher/api/requests/clan_builder_base_rankings.py index 5467445..0572ded 100644 --- a/pyclasher/api/requests/clan_builder_base_rankings.py +++ b/pyclasher/api/requests/clan_builder_base_rankings.py @@ -2,6 +2,11 @@ from ..models import ClanBuilderBaseRanking, ClanBuilderBaseRankingList +__all__ = ( + 'ClanBuilderBaseRankingsRequest', +) + + class ClanBuilderBaseRankingsRequest(IterRequestModel): _iter_rtype = ClanBuilderBaseRanking _list_rtype = ClanBuilderBaseRankingList diff --git a/pyclasher/api/requests/clan_builder_base_rankings.pyi b/pyclasher/api/requests/clan_builder_base_rankings.pyi index af1372c..1435a19 100644 --- a/pyclasher/api/requests/clan_builder_base_rankings.pyi +++ b/pyclasher/api/requests/clan_builder_base_rankings.pyi @@ -5,6 +5,11 @@ from ..models import ClanBuilderBaseRanking, ClanBuilderBaseRankingList, \ Location +__all__ = ( + 'ClanBuilderBaseRankingsRequest', +) + + class ClanBuilderBaseRankingsRequest(IterRequestModel): _iter_rtype = ClanBuilderBaseRanking _list_rtype = ClanBuilderBaseRankingList diff --git a/pyclasher/api/requests/clan_capital_raid_seasons.py b/pyclasher/api/requests/clan_capital_raid_seasons.py index f245fcc..23f7551 100644 --- a/pyclasher/api/requests/clan_capital_raid_seasons.py +++ b/pyclasher/api/requests/clan_capital_raid_seasons.py @@ -1,6 +1,10 @@ from .abc import IterRequestModel from ..models import ClanCapitalRaidSeasons, ClanCapitalRaidSeason +__all__ = ( + 'ClanCapitalRaidSeasonsRequest', +) + class ClanCapitalRaidSeasonsRequest(IterRequestModel): """ diff --git a/pyclasher/api/requests/clan_capital_raid_seasons.pyi b/pyclasher/api/requests/clan_capital_raid_seasons.pyi index 52dedd8..2d10e43 100644 --- a/pyclasher/api/requests/clan_capital_raid_seasons.pyi +++ b/pyclasher/api/requests/clan_capital_raid_seasons.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import ClanCapitalRaidSeasons, ClanCapitalRaidSeason +__all__ = ( + 'ClanCapitalRaidSeasonsRequest', +) + + class ClanCapitalRaidSeasonsRequest(IterRequestModel): _iter_rtype = ClanCapitalRaidSeason _list_rtype = ClanCapitalRaidSeasons diff --git a/pyclasher/api/requests/clan_current_war.py b/pyclasher/api/requests/clan_current_war.py index 2941a75..ade7482 100644 --- a/pyclasher/api/requests/clan_current_war.py +++ b/pyclasher/api/requests/clan_current_war.py @@ -2,6 +2,11 @@ from ..models import ClanWar, BaseClan, ClanWarState +__all__ = ( + 'ClanCurrentWarRequest', +) + + class ClanCurrentWarRequest(RequestModel, ClanWar): """ Retrieve information about clan's current clan war diff --git a/pyclasher/api/requests/clan_current_war.pyi b/pyclasher/api/requests/clan_current_war.pyi index 205f90e..04d9be9 100644 --- a/pyclasher/api/requests/clan_current_war.pyi +++ b/pyclasher/api/requests/clan_current_war.pyi @@ -2,6 +2,11 @@ from .abc import RequestModel from ..models import ClanWar, BaseClan +__all__ = ( + 'ClanCurrentWarRequest', +) + + class ClanCurrentWarRequest(RequestModel, ClanWar): clan_tag: str = None diff --git a/pyclasher/api/requests/clan_currentwar_leaguegroup.py b/pyclasher/api/requests/clan_currentwar_leaguegroup.py index 7aef9f4..f8ee395 100644 --- a/pyclasher/api/requests/clan_currentwar_leaguegroup.py +++ b/pyclasher/api/requests/clan_currentwar_leaguegroup.py @@ -2,6 +2,11 @@ from ..models import ClanWarLeagueGroup +__all__ = ( + 'ClanCurrentwarLeaguegroupRequest', +) + + class ClanCurrentwarLeaguegroupRequest(RequestModel, ClanWarLeagueGroup): """ Retrieve information about clan's current clan war league group diff --git a/pyclasher/api/requests/clan_currentwar_leaguegroup.pyi b/pyclasher/api/requests/clan_currentwar_leaguegroup.pyi index b2865c2..db519f1 100644 --- a/pyclasher/api/requests/clan_currentwar_leaguegroup.pyi +++ b/pyclasher/api/requests/clan_currentwar_leaguegroup.pyi @@ -2,6 +2,11 @@ from .abc import RequestModel from ..models import ClanWarLeagueGroup, BaseClan +__all__ = ( + 'ClanCurrentwarLeaguegroupRequest', +) + + class ClanCurrentwarLeaguegroupRequest(RequestModel, ClanWarLeagueGroup): clan_tag: str = None diff --git a/pyclasher/api/requests/clan_labels.py b/pyclasher/api/requests/clan_labels.py index e467462..fd66169 100644 --- a/pyclasher/api/requests/clan_labels.py +++ b/pyclasher/api/requests/clan_labels.py @@ -2,6 +2,11 @@ from ..models import LabelList, Label +__all__ = ( + 'ClanLabelsRequest', +) + + class ClanLabelsRequest(IterRequestModel): _iter_rtype = Label _list_rtype = LabelList diff --git a/pyclasher/api/requests/clan_labels.pyi b/pyclasher/api/requests/clan_labels.pyi index 80028d2..327a5b0 100644 --- a/pyclasher/api/requests/clan_labels.pyi +++ b/pyclasher/api/requests/clan_labels.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import LabelList, Label +__all__ = ( + 'ClanLabelsRequest', +) + + class ClanLabelsRequest(IterRequestModel): _iter_rtype = Label _list_rtype = LabelList diff --git a/pyclasher/api/requests/clan_members.py b/pyclasher/api/requests/clan_members.py index 2fbbf35..8eb9020 100644 --- a/pyclasher/api/requests/clan_members.py +++ b/pyclasher/api/requests/clan_members.py @@ -2,6 +2,11 @@ from ..models import ClanMember, ClanMemberList +__all__ = ( + 'ClanMembersRequest', +) + + class ClanMembersRequest(IterRequestModel): """ List clan members. diff --git a/pyclasher/api/requests/clan_members.pyi b/pyclasher/api/requests/clan_members.pyi index 820e485..a77691b 100644 --- a/pyclasher/api/requests/clan_members.pyi +++ b/pyclasher/api/requests/clan_members.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import ClanMember, ClanMemberList +__all__ = ( + 'ClanMembersRequest', +) + + class ClanMembersRequest(IterRequestModel): _iter_rtype = ClanMember _list_rtype = ClanMemberList diff --git a/pyclasher/api/requests/clan_rankings.py b/pyclasher/api/requests/clan_rankings.py index 3bd386c..0312a87 100644 --- a/pyclasher/api/requests/clan_rankings.py +++ b/pyclasher/api/requests/clan_rankings.py @@ -2,6 +2,11 @@ from ..models import ClanRanking, ClanRankingList +__all__ = ( + 'ClanRankingsRequest', +) + + class ClanRankingsRequest(IterRequestModel): _iter_rtype = ClanRanking _list_rtype = ClanRankingList diff --git a/pyclasher/api/requests/clan_rankings.pyi b/pyclasher/api/requests/clan_rankings.pyi index e4a8348..bcba2fc 100644 --- a/pyclasher/api/requests/clan_rankings.pyi +++ b/pyclasher/api/requests/clan_rankings.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import ClanRanking, ClanRankingList, Location +__all__ = ( + 'ClanRankingsRequest', +) + + class ClanRankingsRequest(IterRequestModel): _iter_rtype = ClanRanking _list_rtype = ClanRankingList diff --git a/pyclasher/api/requests/clan_search.py b/pyclasher/api/requests/clan_search.py index 2b18d11..bf98f0a 100644 --- a/pyclasher/api/requests/clan_search.py +++ b/pyclasher/api/requests/clan_search.py @@ -2,6 +2,11 @@ from ..models import ClanList, WarFrequency, Locations, Labels, Clan +__all__ = ( + 'ClanSearchRequest', +) + + class ClanSearchRequest(IterRequestModel): """ Search all clans by name and/or filtering the results using various criteria. diff --git a/pyclasher/api/requests/clan_search.pyi b/pyclasher/api/requests/clan_search.pyi index c50e0d7..9d8ce78 100644 --- a/pyclasher/api/requests/clan_search.pyi +++ b/pyclasher/api/requests/clan_search.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import ClanList, WarFrequency, Locations, Labels, Clan +__all__ = ( + 'ClanSearchRequest', +) + + class ClanSearchRequest(IterRequestModel): clan_name: str = None _iter_rtype = Clan diff --git a/pyclasher/api/requests/clan_war_log.py b/pyclasher/api/requests/clan_war_log.py index 430d5b0..fb0469f 100644 --- a/pyclasher/api/requests/clan_war_log.py +++ b/pyclasher/api/requests/clan_war_log.py @@ -7,6 +7,11 @@ from ...utils import snake_to_camel +__all__ = ( + 'ClanWarLogRequest', +) + + class ClanWarLogRequest(IterRequestModel): """ Retrieve clan's clan war log. diff --git a/pyclasher/api/requests/clan_war_log.pyi b/pyclasher/api/requests/clan_war_log.pyi index 6cf1eb2..a9f815a 100644 --- a/pyclasher/api/requests/clan_war_log.pyi +++ b/pyclasher/api/requests/clan_war_log.pyi @@ -5,6 +5,11 @@ from ..models import ClanWarLog, ClanWarLogEntry from ..models.enums import ClanWarResult +__all__ = ( + 'ClanWarLogRequest', +) + + class ClanWarLogRequest(IterRequestModel): clan_tag: str = None _iter_rtype = ClanWarLogEntry diff --git a/pyclasher/api/requests/clan_warleagues_wars.py b/pyclasher/api/requests/clan_warleagues_wars.py index 826dffb..63b8c0a 100644 --- a/pyclasher/api/requests/clan_warleagues_wars.py +++ b/pyclasher/api/requests/clan_warleagues_wars.py @@ -2,6 +2,11 @@ from ..models import ClanWar +__all__ = ( + 'ClanWarleaguesWarsRequest', +) + + class ClanWarleaguesWarsRequest(RequestModel, ClanWar): """ Retrieve information about individual clan war league war diff --git a/pyclasher/api/requests/clan_warleagues_wars.pyi b/pyclasher/api/requests/clan_warleagues_wars.pyi index f558b64..a19e4dc 100644 --- a/pyclasher/api/requests/clan_warleagues_wars.pyi +++ b/pyclasher/api/requests/clan_warleagues_wars.pyi @@ -2,6 +2,11 @@ from .abc import RequestModel from ..models import ClanWar +__all__ = ( + 'ClanWarleaguesWarsRequest', +) + + class ClanWarleaguesWarsRequest(RequestModel, ClanWar): """ Retrieve information about individual clan war league war diff --git a/pyclasher/api/requests/gold_pass.py b/pyclasher/api/requests/gold_pass.py index 2d0d5e5..04b1a7a 100644 --- a/pyclasher/api/requests/gold_pass.py +++ b/pyclasher/api/requests/gold_pass.py @@ -2,6 +2,11 @@ from ..models import GoldPassSeason +__all__ = ( + 'GoldPassRequest', +) + + class GoldPassRequest(RequestModel, GoldPassSeason): def __init__(self): RequestModel.__init__(self, "goldpass/seasons/current") diff --git a/pyclasher/api/requests/gold_pass.pyi b/pyclasher/api/requests/gold_pass.pyi index 859e0b4..7f27aec 100644 --- a/pyclasher/api/requests/gold_pass.pyi +++ b/pyclasher/api/requests/gold_pass.pyi @@ -2,6 +2,11 @@ from .abc import RequestModel from ..models import GoldPassSeason +__all__ = ( + 'GoldPassRequest', +) + + class GoldPassRequest(RequestModel, GoldPassSeason): def __init__(self) -> None: ... diff --git a/pyclasher/api/requests/league.py b/pyclasher/api/requests/league.py index 377ad4a..cf15bb8 100644 --- a/pyclasher/api/requests/league.py +++ b/pyclasher/api/requests/league.py @@ -2,6 +2,11 @@ from ..models import League +__all__ = ( + 'LeagueRequest', +) + + class LeagueRequest(RequestModel, League): def __init__(self, league_id): RequestModel.__init__(self, diff --git a/pyclasher/api/requests/league.pyi b/pyclasher/api/requests/league.pyi index 410b31e..ff46f27 100644 --- a/pyclasher/api/requests/league.pyi +++ b/pyclasher/api/requests/league.pyi @@ -2,6 +2,11 @@ from .abc import RequestModel from ..models import League +__all__ = ( + 'LeagueRequest', +) + + class LeagueRequest(RequestModel, League): def __init__(self, league_id: int): self.league_id = league_id diff --git a/pyclasher/api/requests/league_season.py b/pyclasher/api/requests/league_season.py index 5739977..7a2bf35 100644 --- a/pyclasher/api/requests/league_season.py +++ b/pyclasher/api/requests/league_season.py @@ -2,6 +2,11 @@ from ..models import PlayerRanking, PlayerRankingList, Season +__all__ = ( + 'LeagueSeasonRequest', +) + + class LeagueSeasonRequest(IterRequestModel): _iter_rtype = PlayerRanking _list_rtype = PlayerRankingList diff --git a/pyclasher/api/requests/league_season.pyi b/pyclasher/api/requests/league_season.pyi index abb0804..8213c4b 100644 --- a/pyclasher/api/requests/league_season.pyi +++ b/pyclasher/api/requests/league_season.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import PlayerRanking, PlayerRankingList, Leagues, Season +__all__ = ( + 'LeagueSeasonRequest', +) + + class LeagueSeasonRequest(IterRequestModel): _iter_rtype = PlayerRanking _list_rtype = PlayerRankingList diff --git a/pyclasher/api/requests/league_seasons.py b/pyclasher/api/requests/league_seasons.py index f35902b..15f63c5 100644 --- a/pyclasher/api/requests/league_seasons.py +++ b/pyclasher/api/requests/league_seasons.py @@ -2,6 +2,11 @@ from ..models import LeagueSeason, LeagueSeasonList +__all__ = ( + 'LeagueSeasonsRequest', +) + + class LeagueSeasonsRequest(IterRequestModel): _iter_rtype = LeagueSeason _list_rtype = LeagueSeasonList diff --git a/pyclasher/api/requests/league_seasons.pyi b/pyclasher/api/requests/league_seasons.pyi index f0b1d6b..6b65394 100644 --- a/pyclasher/api/requests/league_seasons.pyi +++ b/pyclasher/api/requests/league_seasons.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import LeagueSeason, LeagueSeasonList +__all__ = ( + 'LeagueSeasonsRequest', +) + + class LeagueSeasonsRequest(IterRequestModel): _iter_rtype = LeagueSeason _list_rtype = LeagueSeasonList diff --git a/pyclasher/api/requests/leagues.py b/pyclasher/api/requests/leagues.py index 10c61d9..c0336cd 100644 --- a/pyclasher/api/requests/leagues.py +++ b/pyclasher/api/requests/leagues.py @@ -2,6 +2,11 @@ from ..models import LeagueList, League +__all__ = ( + 'LeaguesRequest', +) + + class LeaguesRequest(IterRequestModel): _iter_rtype = League _list_rtype = LeagueList diff --git a/pyclasher/api/requests/leagues.pyi b/pyclasher/api/requests/leagues.pyi index ca3372c..fa9f3aa 100644 --- a/pyclasher/api/requests/leagues.pyi +++ b/pyclasher/api/requests/leagues.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import LeagueList, League +__all__ = ( + 'LeaguesRequest', +) + + class LeaguesRequest(IterRequestModel): _iter_rtype = League _list_rtype = LeagueList diff --git a/pyclasher/api/requests/location.py b/pyclasher/api/requests/location.py index 95a6ddf..4d7ea80 100644 --- a/pyclasher/api/requests/location.py +++ b/pyclasher/api/requests/location.py @@ -2,6 +2,11 @@ from ..models import Location +__all__ = ( + 'LocationRequest', +) + + class LocationRequest(RequestModel, Location): def __init__(self, location_id): RequestModel.__init__(self, diff --git a/pyclasher/api/requests/location.pyi b/pyclasher/api/requests/location.pyi index 1de39fd..3cb027c 100644 --- a/pyclasher/api/requests/location.pyi +++ b/pyclasher/api/requests/location.pyi @@ -2,6 +2,11 @@ from .abc import RequestModel from ..models import Location +__all__ = ( + 'LocationRequest', +) + + class LocationRequest(RequestModel, Location): def __init__(self, location_id: int): self.location_id = location_id diff --git a/pyclasher/api/requests/locations.py b/pyclasher/api/requests/locations.py index f466ae8..f6d79e1 100644 --- a/pyclasher/api/requests/locations.py +++ b/pyclasher/api/requests/locations.py @@ -2,6 +2,11 @@ from ..models import Location, LocationList +__all__ = ( + 'LocationsRequest', +) + + class LocationsRequest(IterRequestModel): _iter_rtype = Location _list_rtype = LocationList diff --git a/pyclasher/api/requests/locations.pyi b/pyclasher/api/requests/locations.pyi index 9ddf17a..c8ebdd5 100644 --- a/pyclasher/api/requests/locations.pyi +++ b/pyclasher/api/requests/locations.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import Location, LocationList +__all__ = ( + 'LocationsRequest', +) + + class LocationsRequest(IterRequestModel): _iter_rtype = Location _list_rtype = LocationList diff --git a/pyclasher/api/requests/player.py b/pyclasher/api/requests/player.py index 3476ad8..a5ab288 100644 --- a/pyclasher/api/requests/player.py +++ b/pyclasher/api/requests/player.py @@ -8,6 +8,11 @@ from ...utils.request_methods import RequestMethods +__all__ = ( + 'PlayerRequest', +) + + class PlayerRequest(RequestModel, Player): """ Get information about a single player by player tag. Player tags can be diff --git a/pyclasher/api/requests/player.pyi b/pyclasher/api/requests/player.pyi index 6df8db9..6024dda 100644 --- a/pyclasher/api/requests/player.pyi +++ b/pyclasher/api/requests/player.pyi @@ -2,6 +2,11 @@ from .abc import RequestModel from ..models import Player, VerifyTokenResponse +__all__ = ( + 'PlayerRequest', +) + + class PlayerRequest(RequestModel, Player): def __init__(self, player_tag: str) -> None: self.player_tag = player_tag diff --git a/pyclasher/api/requests/player_builder_base_rankings.py b/pyclasher/api/requests/player_builder_base_rankings.py index 64a017a..c4fad7f 100644 --- a/pyclasher/api/requests/player_builder_base_rankings.py +++ b/pyclasher/api/requests/player_builder_base_rankings.py @@ -2,6 +2,11 @@ from ..models import PlayerBuilderBaseRanking, PlayerBuilderBaseRankingList +__all__ = ( + 'PlayerBuilderBaseRankingsRequest', +) + + class PlayerBuilderBaseRankingsRequest(IterRequestModel): _iter_rtype = PlayerBuilderBaseRanking _list_rtype = PlayerBuilderBaseRankingList diff --git a/pyclasher/api/requests/player_builder_base_rankings.pyi b/pyclasher/api/requests/player_builder_base_rankings.pyi index cf8f685..f3cfe18 100644 --- a/pyclasher/api/requests/player_builder_base_rankings.pyi +++ b/pyclasher/api/requests/player_builder_base_rankings.pyi @@ -5,6 +5,11 @@ from ..models import PlayerBuilderBaseRanking, PlayerBuilderBaseRankingList, \ Location +__all__ = ( + 'PlayerBuilderBaseRankingsRequest', +) + + class PlayerBuilderBaseRankingsRequest(IterRequestModel): _iter_rtype = PlayerBuilderBaseRanking _list_rtype = PlayerBuilderBaseRankingList diff --git a/pyclasher/api/requests/player_labels.py b/pyclasher/api/requests/player_labels.py index 1bef6e0..a190d3c 100644 --- a/pyclasher/api/requests/player_labels.py +++ b/pyclasher/api/requests/player_labels.py @@ -2,6 +2,11 @@ from ..models import LabelList, Label +__all__ = ( + 'PlayerLabelsRequest', +) + + class PlayerLabelsRequest(IterRequestModel): _iter_rtype = Label _list_rtype = LabelList diff --git a/pyclasher/api/requests/player_labels.pyi b/pyclasher/api/requests/player_labels.pyi index cd57aff..ccc0bf4 100644 --- a/pyclasher/api/requests/player_labels.pyi +++ b/pyclasher/api/requests/player_labels.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import LabelList, Label +__all__ = ( + 'PlayerLabelsRequest', +) + + class PlayerLabelsRequest(IterRequestModel): _iter_rtype = Label _list_rtype = LabelList diff --git a/pyclasher/api/requests/player_rankings.py b/pyclasher/api/requests/player_rankings.py index 5cccfa7..e210f41 100644 --- a/pyclasher/api/requests/player_rankings.py +++ b/pyclasher/api/requests/player_rankings.py @@ -2,6 +2,11 @@ from ..models import PlayerRanking, PlayerRankingList +__all__ = ( + 'PlayerRankingsRequest', +) + + class PlayerRankingsRequest(IterRequestModel): _iter_rtype = PlayerRanking _list_rtype = PlayerRankingList diff --git a/pyclasher/api/requests/player_rankings.pyi b/pyclasher/api/requests/player_rankings.pyi index 0532046..52a4361 100644 --- a/pyclasher/api/requests/player_rankings.pyi +++ b/pyclasher/api/requests/player_rankings.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import PlayerRanking, PlayerRankingList, Location +__all__ = ( + 'PlayerRankingsRequest', +) + + class PlayerRankingsRequest(IterRequestModel): _iter_rtype = PlayerRanking _list_rtype = PlayerRankingList diff --git a/pyclasher/api/requests/war_league.py b/pyclasher/api/requests/war_league.py index e235972..10abef1 100644 --- a/pyclasher/api/requests/war_league.py +++ b/pyclasher/api/requests/war_league.py @@ -2,6 +2,11 @@ from ..models import WarLeague +__all__ = ( + 'WarLeagueRequest', +) + + class WarLeagueRequest(RequestModel, WarLeague): def __init__(self, league_id): RequestModel.__init__(self, "warleagues/{league_id}", diff --git a/pyclasher/api/requests/war_league.pyi b/pyclasher/api/requests/war_league.pyi index a6396f0..53497cc 100644 --- a/pyclasher/api/requests/war_league.pyi +++ b/pyclasher/api/requests/war_league.pyi @@ -2,6 +2,11 @@ from .abc import RequestModel from ..models import WarLeague +__all__ = ( + 'WarLeagueRequest', +) + + class WarLeagueRequest(RequestModel, WarLeague): def __init__(self, league_id: int): self.league_id = league_id diff --git a/pyclasher/api/requests/war_leagues.py b/pyclasher/api/requests/war_leagues.py index a10e4b7..bf8fb7f 100644 --- a/pyclasher/api/requests/war_leagues.py +++ b/pyclasher/api/requests/war_leagues.py @@ -2,6 +2,11 @@ from ..models import WarLeagueList, WarLeague +__all__ = ( + 'WarLeaguesRequest', +) + + class WarLeaguesRequest(IterRequestModel): _iter_rtype = WarLeague _list_rtype = WarLeagueList diff --git a/pyclasher/api/requests/war_leagues.pyi b/pyclasher/api/requests/war_leagues.pyi index 02bbb6a..0453527 100644 --- a/pyclasher/api/requests/war_leagues.pyi +++ b/pyclasher/api/requests/war_leagues.pyi @@ -4,6 +4,11 @@ from .abc import IterRequestModel from ..models import WarLeagueList, WarLeague +__all__ = ( + 'WarLeaguesRequest', +) + + class WarLeaguesRequest(IterRequestModel): _iter_rtype = WarLeague _list_rtype = WarLeagueList From 529018bf42345f084d04901d7883481d9e14f3a9 Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Sun, 1 Oct 2023 21:55:46 +0200 Subject: [PATCH 08/12] fix: api requests import --- pyclasher/api/models/__init__.py | 8 +--- pyclasher/api/models/clan_list.py | 2 +- pyclasher/api/models/clan_list.pyi | 2 +- pyclasher/api/requests/__init__.py | 61 +++++++++++++++--------------- 4 files changed, 33 insertions(+), 40 deletions(-) diff --git a/pyclasher/api/models/__init__.py b/pyclasher/api/models/__init__.py index b70258c..39dea1d 100644 --- a/pyclasher/api/models/__init__.py +++ b/pyclasher/api/models/__init__.py @@ -1,11 +1,7 @@ """ ClashOfClans API models """ -# abc -from .abc import ( - BaseModel, - IterBaseModel -) + # base models, miscellaneous models and enums from .base_models import ( ImageUrl, @@ -166,11 +162,9 @@ 'WarClan', 'PlayerRankingClan', 'PlayerRanking', - 'IterBaseModel', 'BaseClan', 'ClanWarAttack', 'Village', - 'BaseModel', 'Player', 'PlayerClan', 'Location', diff --git a/pyclasher/api/models/clan_list.py b/pyclasher/api/models/clan_list.py index c7486f3..a6aeade 100644 --- a/pyclasher/api/models/clan_list.py +++ b/pyclasher/api/models/clan_list.py @@ -3,7 +3,7 @@ __all__ = ( - 'ClanList1', + 'ClanList', ) diff --git a/pyclasher/api/models/clan_list.pyi b/pyclasher/api/models/clan_list.pyi index e7ab94e..3c21495 100644 --- a/pyclasher/api/models/clan_list.pyi +++ b/pyclasher/api/models/clan_list.pyi @@ -5,7 +5,7 @@ from .clan import Clan __all__ = ( - 'ClanList1', + 'ClanList', ) diff --git a/pyclasher/api/requests/__init__.py b/pyclasher/api/requests/__init__.py index ef7c33a..cf1d1b0 100644 --- a/pyclasher/api/requests/__init__.py +++ b/pyclasher/api/requests/__init__.py @@ -2,7 +2,6 @@ requests that can be used """ -from .abc import RequestModel, IterRequestModel, request_id from .builder_base_league import BuilderBaseLeagueRequest from .builder_base_leagues import BuilderBaseLeaguesRequest from .capital_league import CapitalLeagueRequest @@ -33,35 +32,35 @@ from .war_league import WarLeagueRequest from .war_leagues import WarLeaguesRequest + __all__ = ( - "BuilderBaseLeagueRequest", - "BuilderBaseLeaguesRequest", - "CapitalLeagueRequest", - "CapitalLeaguesRequest", - "CapitalRankingsRequest", - "ClanRequest", - "ClanBuilderBaseRankingsRequest", - "ClanCapitalRaidSeasonsRequest", - "ClanCurrentWarRequest", - "ClanCurrentwarLeaguegroupRequest", - "ClanLabelsRequest", - "ClanMembersRequest", - "ClanRankingsRequest", - "ClanSearchRequest", - "ClanWarLogRequest", - "ClanWarleaguesWarsRequest", - "GoldPassRequest", - "LeagueRequest", - "LeagueSeasonRequest", - "LeagueSeasonsRequest", - "LeaguesRequest", - "LocationRequest", - "LocationsRequest", - "PlayerRequest", - "PlayerBuilderBaseRankingsRequest", - "PlayerLabelsRequest", - "PlayerRankingsRequest", - "WarLeagueRequest", - "WarLeaguesRequest" + 'WarLeagueRequest', + 'WarLeaguesRequest', + 'CapitalLeagueRequest', + 'CapitalLeaguesRequest', + 'CapitalRankingsRequest', + 'BuilderBaseLeagueRequest', + 'BuilderBaseLeaguesRequest', + 'PlayerLabelsRequest', + 'PlayerRankingsRequest', + 'LeaguesRequest', + 'LocationRequest', + 'PlayerRequest', + 'LocationsRequest', + 'LeagueSeasonsRequest', + 'PlayerBuilderBaseRankingsRequest', + 'LeagueRequest', + 'ClanRequest', + 'GoldPassRequest', + 'LeagueSeasonRequest', + 'ClanSearchRequest', + 'ClanRankingsRequest', + 'ClanLabelsRequest', + 'ClanMembersRequest', + 'ClanWarLogRequest', + 'ClanWarleaguesWarsRequest', + 'ClanCurrentwarLeaguegroupRequest', + 'ClanCurrentWarRequest', + 'ClanCapitalRaidSeasonsRequest', + 'ClanBuilderBaseRankingsRequest', ) - From d6403f6f508828851609b0bb105fdd0a542698d9 Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Sun, 1 Oct 2023 21:58:11 +0200 Subject: [PATCH 09/12] rebase: api import --- pyclasher/api/__init__.py | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/pyclasher/api/__init__.py b/pyclasher/api/__init__.py index c39edf6..bd80f62 100644 --- a/pyclasher/api/__init__.py +++ b/pyclasher/api/__init__.py @@ -1,6 +1,36 @@ -from .bulk_requests import * -from .models import * -from .requests import * +from .bulk_requests import PlayerBulkRequest +from .requests import ( + BuilderBaseLeagueRequest, + BuilderBaseLeaguesRequest, + CapitalLeagueRequest, + CapitalLeaguesRequest, + CapitalRankingsRequest, + ClanRequest, + ClanBuilderBaseRankingsRequest, + ClanCapitalRaidSeasonsRequest, + ClanCurrentWarRequest, + ClanCurrentwarLeaguegroupRequest, + ClanLabelsRequest, + ClanMembersRequest, + ClanRankingsRequest, + ClanSearchRequest, + ClanWarLogRequest, + ClanWarleaguesWarsRequest, + GoldPassRequest, + LeagueRequest, + LeagueSeasonRequest, + LeagueSeasonsRequest, + LeaguesRequest, + LocationRequest, + LocationsRequest, + PlayerRequest, + PlayerBuilderBaseRankingsRequest, + PlayerLabelsRequest, + PlayerRankingsRequest, + WarLeagueRequest, + WarLeaguesRequest +) + __all__ = ( "PlayerBulkRequest", From b5b2b7ad780f2ff72abde79a9ac9d1a2696e21e9 Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Mon, 2 Oct 2023 12:07:46 +0200 Subject: [PATCH 10/12] rebase: client, utils & exceptions import --- pyclasher/__init__.py | 34 +++++++++++++++++++++------ pyclasher/client/client.py | 5 ++++ pyclasher/client/client.pyi | 6 +++++ pyclasher/client/request_consumer.py | 6 ++++- pyclasher/client/request_consumer.pyi | 5 ++++ pyclasher/client/request_queue.py | 5 ++++ pyclasher/client/request_queue.pyi | 5 ++++ pyclasher/exceptions.py | 29 +++++++++++++++++++++++ pyclasher/exceptions.pyi | 29 +++++++++++++++++++++++ pyclasher/utils/__init__.py | 8 +++++++ pyclasher/utils/exectimer.py | 5 ++++ pyclasher/utils/exectimer.pyi | 5 ++++ pyclasher/utils/functions.py | 5 ++++ pyclasher/utils/functions.pyi | 5 ++++ pyclasher/utils/login.py | 5 ++++ pyclasher/utils/login.pyi | 5 ++++ pyclasher/utils/request_methods.py | 5 ++++ pyclasher/utils/request_methods.pyi | 5 ++++ 18 files changed, 164 insertions(+), 8 deletions(-) diff --git a/pyclasher/__init__.py b/pyclasher/__init__.py index 1a2f304..11d603d 100644 --- a/pyclasher/__init__.py +++ b/pyclasher/__init__.py @@ -11,15 +11,35 @@ __version__ = '1.0.0' -from .api import * +from .api.bulk_requests import * +from .api.requests import * from .client import Client from .exceptions import ( - PyClasherException, ApiException, ApiExceptions, UnknownApiException, - MISSING, Missing, RequestNotDone, RequestTimeout, BadRequest, NotFound, - Throttled, Maintenance, AccessDenied, NoClient, InvalidClientId, - ClientIsRunning, ClientIsNotRunning, ClientRunningOverwrite, - ClientAlreadyInitialised, LoginNotDone, InvalidLoginData, InvalidType, - InvalidTimeFormat, InvalidSeasonFormat, NoneToken + PyClasherException, + ApiException, + ApiExceptions, + UnknownApiException, + MISSING, + Missing, + RequestNotDone, + RequestTimeout, + BadRequest, + NotFound, + Throttled, + Maintenance, + AccessDenied, + NoClient, + InvalidClientId, + ClientIsRunning, + ClientIsNotRunning, + ClientRunningOverwrite, + ClientAlreadyInitialised, + LoginNotDone, + InvalidLoginData, + InvalidType, + InvalidTimeFormat, + InvalidSeasonFormat, + NoneToken ) __all__ = ( diff --git a/pyclasher/client/client.py b/pyclasher/client/client.py index 6800b73..b83496c 100644 --- a/pyclasher/client/client.py +++ b/pyclasher/client/client.py @@ -18,6 +18,11 @@ from pyclasher.utils.login import Login +__all__ = ( + 'Client', +) + + global_client_id = 0 """Global variable for counting and identifying clients""" diff --git a/pyclasher/client/client.pyi b/pyclasher/client/client.pyi index 610f6ed..29808aa 100644 --- a/pyclasher/client/client.pyi +++ b/pyclasher/client/client.pyi @@ -5,6 +5,12 @@ from typing import Iterable from ..exceptions import MISSING from .request_queue import PQueue + +__all__ = ( + 'Client', +) + + global_client_id: int = ... diff --git a/pyclasher/client/request_consumer.py b/pyclasher/client/request_consumer.py index b968444..dfa177b 100644 --- a/pyclasher/client/request_consumer.py +++ b/pyclasher/client/request_consumer.py @@ -8,6 +8,11 @@ from pyclasher.utils import ExecutionTimer +__all__ = ( + 'PConsumer', +) + + class PConsumer: def __init__(self, queue, token, requests_per_s, request_timeout, url): self.queue = queue @@ -55,7 +60,6 @@ async def _request(self, future, url, method, body, status, error): error.set_result(exception) raise exception - async def consume(self): while True: future, url, method, body, status, error = await self.queue.get() diff --git a/pyclasher/client/request_consumer.pyi b/pyclasher/client/request_consumer.pyi index a5b8aed..322dedf 100644 --- a/pyclasher/client/request_consumer.pyi +++ b/pyclasher/client/request_consumer.pyi @@ -5,6 +5,11 @@ from aiohttp import ClientSession from .request_queue import PQueue +__all__ = ( + 'PConsumer', +) + + class PConsumer: """ consumer class that consumes the requests and returns the responses of the ClashOfClans API diff --git a/pyclasher/client/request_queue.py b/pyclasher/client/request_queue.py index e940541..7d76802 100644 --- a/pyclasher/client/request_queue.py +++ b/pyclasher/client/request_queue.py @@ -1,6 +1,11 @@ from asyncio import Queue +__all__ = ( + 'PQueue', +) + + class PQueue(Queue): async def put(self, future, diff --git a/pyclasher/client/request_queue.pyi b/pyclasher/client/request_queue.pyi index 1f40656..4f6e0b8 100644 --- a/pyclasher/client/request_queue.pyi +++ b/pyclasher/client/request_queue.pyi @@ -3,6 +3,11 @@ from asyncio import Queue, Future from ..utils.request_methods import RequestMethods +__all__ = ( + 'PQueue', +) + + class PQueue(Queue): async def put(self, future: Future, diff --git a/pyclasher/exceptions.py b/pyclasher/exceptions.py index cd61ebe..4133bc6 100644 --- a/pyclasher/exceptions.py +++ b/pyclasher/exceptions.py @@ -6,6 +6,35 @@ """ +__all__ = ( + 'PyClasherException', + 'Missing', + 'MISSING', + 'LoginNotDone', + 'RequestTimeout', + 'InvalidLoginData', + 'NotFound', + 'BadRequest', + 'AccessDenied', + 'ApiException', + 'Throttled', + 'Maintenance', + 'NoClient', + 'NoneToken', + 'InvalidType', + 'UnknownApiException', + 'ApiExceptions', + 'InvalidClientId', + 'ClientIsRunning', + 'RequestNotDone', + 'InvalidTimeFormat', + 'InvalidSeasonFormat', + 'ClientIsNotRunning', + 'ClientRunningOverwrite', + 'ClientAlreadyInitialised', +) + + class Missing: """ Class of the ``MISSING`` object diff --git a/pyclasher/exceptions.pyi b/pyclasher/exceptions.pyi index 6f98c1e..3ff32e7 100644 --- a/pyclasher/exceptions.pyi +++ b/pyclasher/exceptions.pyi @@ -11,6 +11,35 @@ from typing import Any from .api.models import ClientError +__all__ = ( + 'PyClasherException', + 'Missing', + 'MISSING', + 'LoginNotDone', + 'RequestTimeout', + 'InvalidLoginData', + 'NotFound', + 'BadRequest', + 'AccessDenied', + 'ApiException', + 'Throttled', + 'Maintenance', + 'NoClient', + 'NoneToken', + 'InvalidType', + 'UnknownApiException', + 'ApiExceptions', + 'InvalidClientId', + 'ClientIsRunning', + 'RequestNotDone', + 'InvalidTimeFormat', + 'InvalidSeasonFormat', + 'ClientIsNotRunning', + 'ClientRunningOverwrite', + 'ClientAlreadyInitialised', +) + + class Missing: """ Class of the ``MISSING`` object diff --git a/pyclasher/utils/__init__.py b/pyclasher/utils/__init__.py index d8e0abd..68f5034 100644 --- a/pyclasher/utils/__init__.py +++ b/pyclasher/utils/__init__.py @@ -2,3 +2,11 @@ from .functions import snake_to_camel from .login import Login from .request_methods import RequestMethods + + +__all__ = ( + 'ExecutionTimer', + 'snake_to_camel', + 'Login', + 'RequestMethods', +) diff --git a/pyclasher/utils/exectimer.py b/pyclasher/utils/exectimer.py index 2daf760..f1b11c0 100644 --- a/pyclasher/utils/exectimer.py +++ b/pyclasher/utils/exectimer.py @@ -2,6 +2,11 @@ from time import perf_counter +__all__ = ( + 'ExecutionTimer', +) + + class ExecutionTimer: def __init__(self, min_time=0): self._min_time = min_time diff --git a/pyclasher/utils/exectimer.pyi b/pyclasher/utils/exectimer.pyi index 7d14c03..57ed23d 100644 --- a/pyclasher/utils/exectimer.pyi +++ b/pyclasher/utils/exectimer.pyi @@ -1,3 +1,8 @@ +__all__ = ( + 'ExecutionTimer', +) + + class ExecutionTimer: def __init__(self, min_time: float = 0) -> None: self._min_time = min_time diff --git a/pyclasher/utils/functions.py b/pyclasher/utils/functions.py index c32a304..09c1f66 100644 --- a/pyclasher/utils/functions.py +++ b/pyclasher/utils/functions.py @@ -1,3 +1,8 @@ +__all__ = ( + 'snake_to_camel', +) + + def snake_to_camel(snake_str: str) -> str: components = snake_str.split('_') camel_str = components[0] + ''.join( diff --git a/pyclasher/utils/functions.pyi b/pyclasher/utils/functions.pyi index 656dc05..9493635 100644 --- a/pyclasher/utils/functions.pyi +++ b/pyclasher/utils/functions.pyi @@ -1,2 +1,7 @@ +__all__ = ( + 'snake_to_camel', +) + + def snake_to_camel(snake_str: str) -> str: ... diff --git a/pyclasher/utils/login.py b/pyclasher/utils/login.py index bb24008..30de2a1 100644 --- a/pyclasher/utils/login.py +++ b/pyclasher/utils/login.py @@ -6,6 +6,11 @@ from ..exceptions import MISSING, LoginNotDone, InvalidLoginData +__all__ = ( + 'Login', +) + + class Login(LoginModel): login_url = "https://developer.clashofclans.com/api/login" __response = None diff --git a/pyclasher/utils/login.pyi b/pyclasher/utils/login.pyi index bdadfae..0c3a575 100644 --- a/pyclasher/utils/login.pyi +++ b/pyclasher/utils/login.pyi @@ -4,6 +4,11 @@ from ..api.models.login import LoginModel from ..exceptions import Missing +__all__ = ( + 'Login', +) + + class Login(LoginModel): """ class to log in via the ClashOfClans login API diff --git a/pyclasher/utils/request_methods.py b/pyclasher/utils/request_methods.py index 9679a2c..0b6a652 100644 --- a/pyclasher/utils/request_methods.py +++ b/pyclasher/utils/request_methods.py @@ -1,6 +1,11 @@ from enum import Enum +__all__ = ( + 'RequestMethods', +) + + class RequestMethods(Enum): REQUEST = "get" POST = "post" diff --git a/pyclasher/utils/request_methods.pyi b/pyclasher/utils/request_methods.pyi index 9679a2c..0b6a652 100644 --- a/pyclasher/utils/request_methods.pyi +++ b/pyclasher/utils/request_methods.pyi @@ -1,6 +1,11 @@ from enum import Enum +__all__ = ( + 'RequestMethods', +) + + class RequestMethods(Enum): REQUEST = "get" POST = "post" From 126198a2c200822064b7056454b9ad0c4dc14e78 Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Mon, 2 Oct 2023 12:13:33 +0200 Subject: [PATCH 11/12] fix: some error fixing --- pyclasher/api/bulk_requests/b_player.py | 2 -- tests/bulk_requests/test_player_bulk.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyclasher/api/bulk_requests/b_player.py b/pyclasher/api/bulk_requests/b_player.py index 257b0d3..bf921fd 100644 --- a/pyclasher/api/bulk_requests/b_player.py +++ b/pyclasher/api/bulk_requests/b_player.py @@ -1,5 +1,3 @@ -from asyncio import get_running_loop, run - from .abc import BulkRequestModel from ..models import BaseClan from ..models import Clan diff --git a/tests/bulk_requests/test_player_bulk.py b/tests/bulk_requests/test_player_bulk.py index 82065cf..8cda942 100644 --- a/tests/bulk_requests/test_player_bulk.py +++ b/tests/bulk_requests/test_player_bulk.py @@ -2,7 +2,7 @@ import pytest -from pyclasher.api import League +from pyclasher.api.models import League from pyclasher.api.bulk_requests import PlayerBulkRequest from pyclasher.api.models import ( WarPreference, PlayerItemLevelList, PlayerHouse, PlayerLegendStatistics, From eef7f2f108375c5dc366a23f496bc4d31e1e2d89 Mon Sep 17 00:00:00 2001 From: 201st-Luka Date: Mon, 2 Oct 2023 12:15:56 +0200 Subject: [PATCH 12/12] fix: fixed testcase because of rebase --- tests/client/test_client.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/client/test_client.py b/tests/client/test_client.py index 5c7c19f..8a6d2b3 100644 --- a/tests/client/test_client.py +++ b/tests/client/test_client.py @@ -13,8 +13,6 @@ async def test_client(): TEST_CLIENT_ID = "test_client_id" - assert not Client.initialized() - client = await Client.from_login(CLASH_OF_CLANS_LOGIN_EMAIL, CLASH_OF_CLANS_LOGIN_PASSWORD) client.client_id = TEST_CLIENT_ID