v3.0.0
Migrating to coc.py v3.0
Most of the outward facing library is the same, with a few changes detailed below. Significant changes are caused
by builder base 2.0 update.
Logging in
The functions :func:coc.login and :func:coc.login_with_keys were removed.
Use :func:coc.Client.login or :func:coc.Client.login_with_tokens instead.
Builder Base v2
The builder base revamp has caused a bunch of breaking changes.
The most significant change is renaming all the :attr:versus things to :attr:builder_base things,
but there were some additions and a removal as well:
- :func:
coc.Client.get_location_clans_versus-> :func:coc.Client.get_location_clans_builder_base - :func:
coc.Client.get_location_players_versus-> :func:coc.Client.get_location_players_builder_base - :func:
coc.Clan.versus_points-> :func:coc.Clan.builder_base_points - :func:
coc.RankedClan.versus_points-> :func:coc.RankedClan.builder_base_points - :func:
coc.ClanMember.versus_trophies-> :func:coc.ClanMember.builder_base_trophies - :func:
coc.ClanMember.versus_rank-> :func:coc.ClanMember.builder_base_rank - :func:
coc.RankedPlayer.versus_trophies-> :func:coc.RankedPlayer.builder_base_trophies - :func:
coc.Player.versus_trophies-> :func:coc.Player.builder_base_trophies - :func:
coc.Player.best_versus_trophies-> :func:coc.Player.best_builder_base_trophies - :func:
coc.LegendStatistics.previous_versus_season-> :func:coc.LegendStatistics.previous_builder_base_season - :func:
coc.LegendStatistics.best_versus_season-> :func:coc.LegendStatistics.best_builder_base_season - :func:
coc.Player.versus_attack_winswas removed - :func:
coc.Clan.required_builder_base_trophieswas added - :func:
coc.ClanMember.builder_base_leaguewas added - :func:
coc.Client.search_builder_base_leagueswas added - :func:
coc.Client.get_builder_base_leaguewas added - :func:
coc.Client.get_builder_base_league_namedwas added
Game Objects
coc.py game data was updated and now includes all the recently added troops and heros.
This is also reflected in the following enumerations:
- :class:
coc.HOME_TROOP_ORDERnow knows the "Apprentice Warden" - :class:
coc.SUPER_TROOP_ORDERnow knows the "Super Hog Rider" - in the :class:
coc.BUILDER_TROOPS_ORDER, "Super P.E.K.K.A" got renamed to "Power P.E.K.K.A" - :class:
coc.BUILDER_TROOPS_ORDERnow knows the "Electrofire Wizard" - :class:
coc.HERO_ORDERnow knows the "Battle Copter"
Leagues
Previously the structure of Leagues was a bit messy and not well aligned with what the API provides.
Therefore they got a small rework:
- :class:
WarLeaguewas replaced with :class:BaseLeaguewhich has the same attributes, but is also used for the builder base league and the clan capital league - :class:
Leagueinherits from :class:BaseLeaguenow and adds the :attr:iconattribute which is present for home village leagues - :class:
Leaguelost its :attr:localized_nameand :attr:localized_short_nameattributes as they are not present in the API
Furthermore
In order to get more in line with our coding style, the following methods were renamed:
- :func:
coc.Client.get_warlog-> :func:coc.Client.get_war_log - :func:
coc.Client.get_raidlog-> :func:coc.Client.get_raid_log
:class:coc.ClanMember has a new cached property: :func:player_house_elements
:class:coc.RaidDistrict has a new :attr:stars attribute
Full Changelog: v2.4.1...v3.0.0