Package: clashpy
Clashpy Python PackageTheClashpyPython package provides a simple and convenient way to interact with the Clash of Clans API, allowing you to retrieve information about clans and players in the Clash of Clans game.InstallationYou can install the Clashpy package using pip:pipinstallclashpyUsageImport the necessary classes from the package:importclashpyapi_key="your_api_key_here"Create an instance of theConnectclass with your API key:connect=clashpy.Connect(api_key)Create instances ofClanorPlayerusing theclanandplayermethods of theConnectinstance:# Example for Clanclan_id="#2YVQ0VJ8P"clan=connect.clan(clan_id)members,chat=clan.info("members","chatLanguage")warlog=clan.warlog()# Example for Playerplayer_tag="#PJ2ULUGQ0"my_player=connect.player(player_tag)heroes,exp=my_player.info("heroes","expLevel")Use the created instances to retrieve information about clans and players.ClassesConnectTheConnectclass is used to create instances of theClanandPlayerclasses, and takes your Clash of Clans API key as an argument.Methods:clan(tag): Create an instance of theClanclass with the specified clan tag.player(tag): Create an instance of thePlayerclass with the specified player tag.ClanTheClanclass allows you to retrieve information about a Clash of Clans clan.Methods:info(*args): Retrieve clan information for the specified attributes. Pass attribute names as arguments to get specific data.members(): Retrieve a list of clan members.warlog(): Retrieve the war log for the clan.capitalraidseasons(): Retrieve the capital raid seasons for the clan.currentwar(): Retrieve information about the clan's current war.warleague(): Retrieve information about the clan's current war league group.warleaguewars(): Retrieve information about the clan's war league wars.Available Arguments:tagnametypedescriptionlocationisFamilyFriendlybadgeUrlsclanLevelclanPointsclanBuilderBasePointsclanVersusPointsclanCapitalPointscapitalLeaguerequiredTrophieswarFrequencywarWinStreakwarWinsisWarLogPublicwarLeaguemembersmemberListlabelsrequiredBuilderBaseTrophiesrequiredVersusTrophiesrequiredTownhallLevelclanCapitalchatLanguagePlayerThePlayerclass allows you to retrieve information about a Clash of Clans player.Methods:info(*args): Retrieve player information for the specified attributes. Pass attribute names as arguments to get specific data.Available Arguments:tagnametownHallLeveltownHallWeaponLevelexpLeveltrophiesbestTrophieswarStarsattackWinsdefenseWinsbuilderHallLevelbuilderBaseTrophiesversusTrophiesbestBuilderBaseTrophiesbestVersusTrophiesversusBattleWinsrolewarPreferencedonationsdonationsReceivedclanCapitalContributionsclanleaguebuilderBaseLeagueachievementsplayerHouselabelstroopsheroesspellsExampleimportclashpyapi_key="your_api_key_here"connect=clashpy.Connect(api_key)# Retrieve clan and player informationclan_id="#2YVQ0VJ8P"clan=connect.clan(clan_id)members,chat=clan.info("members","chatLanguage")warlog=clan.warlog()player_tag="#PJ2ULUGQ0"my_player=connect.player(player_tag)heroes,exp=my_player.info("heroes","expLevel")ContributingContributions are welcome! Feel free to open issues or submit pull requests on the GitHub repository.LicenseThis package is open-source and available under theMIT License.