Releases: mathsman5133/coc.py
v3.2.0
Additions:
- Added custom class support to a few more classes:
- :class:
ClanWarMembernow supports the :attr:attack_clsattribute to customize the type returned in
:func:ClanWarMember.attacks(and, by extension also :func:WarClan.attacksand :func:ClanWar.attacks) - :class:
WarClannow supports the :attr:member_clsattribute to customize the type returned in
:func:WarClan.members(and, by extension also :func:ClanWar.members) - :class:
ClanWarnow supports the :attr:clan_clsattribute to customize the types of
:func:ClanWar.clanand :func:ClanWar.opponent - the :class:
Equipmentclass can now be imported ascoc.Equipment
- :class:
Full Changelog: v3.1.0...v3.2.0
v3.1.0
Additions:
- Added support for Hero Equipment:
- an
Equipmentclass - a cached
Player.equipmentproperty andPlayer.get_equipmentmethod. Equipment obtained this way will be enriched with game data if enabled - a
Hero.equipmentattribute to return the currently active equipment for a hero. Equipment obtained this way will never be enriched with game data and only have the basicname,level,max_levelandvillageattributes
- an
- Added the new Root Rider troop
- Added the new Spirit Fox pet
- The
ClanMemberclass now has atown_hallattribute that will also be present inClan.membersandClan.get_members
Bugs Fixed:
- Fixed an issue that would cause troop and hero change events to fire even when no upgrades were detected
- Fixed the army link parser
Full Changelog: v3.0.0...v3.1.0
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
v2.4.1
Bugs Fixed:
-
Fixed a bug with the retrieval of api keys
-
Fixed
ClanEvents.member_count
Full Changelog: v2.4.0...v2.4.1
v2.4.0
v2.4.0
Additions:
-
Added support for Player Houses in the clan capital: :func:
coc.Player.player_house_elements -
Added optional cls parameters to all the :func:
coc.Client.get_location_...methods
in order to allow the usage of custom classes -
Added the :ref:
triggers -
Added some cached properties to raid classes: :func:
coc.RaidClan.looted,
:func:coc.RaidLogEntry.total_defensive_loot, :func:coc.RaidLogEntry.defense_attack_count
and :func:coc.RaidLogEntry.defensive_destroyed_district_count -
Added
before,afterandlimitparameters to :func:coc.Client.get_members, :func:coc.Client.get_warlogand
:func:coc.Client.get_raidlog -
Added :func:
coc.Client.search_war_leagues, :func:coc.Client.get_war_league,
:func:coc.Client.get_war_league_named, :func:coc.Client.search_capital_leagues,
:func:coc.Client.get_capital_leagueand :func:coc.Client.get_capital_league_named
Changes:
- Changed the default value of the :attr:
coc.Client.throttle_limitto a more reasonable value (30 instead of 10)
Bugs Fixed:
-
Fixed a bug which affected :func:
coc.Client.login_with_keys -
Fixed a bug which caused an overwrite of user set parameters if the client was used with a context manager
-
Fixed a bug which resulted in the client using more keys than the key_count was
-
Fixed a bug which caused a wrong throttle_limit if :func:
coc.Client.login_with_keysor
:func:coc.Client.login_with_tokenswas used -
Added previously missing Attribute :attr:
coc.RaidAttack.starswhich fixed a bug when checking
if two :class:coc.RaidAttackobjects are equal -
Fixed a bug in :func:
coc.WarEvents.new_war -
Fixed a bug in :func:
coc.Client.get_current_warwhich caused Exceptions or wrong return values
What's Changed (auto generated by github)
- update g8_2.4.0 by @doluk in #176
- Easier fix for login_with_tokens() by @AumJavalgikar in #175
- Fixed bug in keys deletion by @AumJavalgikar in #178
- add_cls_params by @Kuchenmampfer in #180
- Fixed the name of a variable in README.rst by @evgepab in #184
- Add trigger extension by @lukasthaler in #182
- Idk why no one noticed this was broken lol by @Kuchenmampfer in #189
- Fix versus trophies in event_example.py by @Pythonic-Rainbow in #190
- fix missing stars attribute bug by @Kuchenmampfer in #185
- extend_raid_log_entry by @Kuchenmampfer in #179
- fix generator return typing + add clan_tag to war class by @MagicTheDev in #188
- Improve eq functions in raid classes by @Kuchenmampfer in #186
- Rename first parameter of various classes hero/spell/troop by @MagicTheDev in #187
- Fix for get_current_war by @doluk in #192
- Bump to 2.4.0 by @doluk in #193
- Fix pyproject.toml by @doluk in #194
New Contributors
- @evgepab made their first contribution in #184
- @Pythonic-Rainbow made their first contribution in #190
Full Changelog: v2.3.1...v2.4.0
v2.3.1
v2.3.1
-
Added back :func:
coc.Client.get_location_clans_capitalwhich was accidentally reverted in 2.3.0 -
Fixed some minor typos in the docs
What's Changed
- Release 2.3.1 by @Kuchenmampfer in #171
- bump version numbers by @Kuchenmampfer in #173
Full Changelog: v2.3.0...v2.3.1
Big Bug fix and feature Release v2.3.0
This release fixes multiple bugs.
Also multiple new features have been added like an event for new wars.
We worked on the docs, to improve their structure and readability.
Additions:
- Added new events
ClientEvents.raid_weekend_start,ClientEvents.raid_weekend_end,ClientEvents.clan_games_start,ClientEvents.clan_games_end,WarEvents.new_warandClanEvents.member_versus_rank - Added utility functions
utils.get_clan_games_start,utils.get_clan_games_end,utils.get_raid_weekend_startandutils.get_raid_weekend_end - Added clan capital leaderboards
- Added
Clan.capital_pointsandClan.family_friendly - Added
ClanMember.versus_rank - Added
Client.raw_attributeto control if the new_raw_dataattribute of various objects gets populated - Added
full_war_apias an extension - Added
Client.login_with_tokensoffering the same functionality asClient.login_with_keysas an asynchronous function
Changes:
- Rename of LRU to FIFO in order to match the cache type (this is only internal)
- Restructured the documentation
Client.login_with_keyswas marked as deprecated
Bugs Fixed:
- Fixed a bug which affected the key creation if there are 10 keys with at least one having the correct name but wrong ip range
- Fixed a memory leak caused by python not properly freeing disk space after the removal of cache entries
- Fixed a bug that prevented :
Client.http.statsfrom collecting API response time stats - Fixed a bug that tried to use a cache when
max_cache_sizewas set to 0 - Corrected order of elixir troops
- Fixed a bug when clans faced each other multiple times in one raid weekend
- Fixed a bug that caused automated tests on forks to fail
- Fixed a bug that prevented you from importing some classes as
coc.Class
Contributions
We want to say thank you to all those who contributed!
- Fix memory leak by @Kuchenmampfer in #154
- Fullwarapi public by @doluk in #164
- add missing classes to init.py by @Kuchenmampfer in #160
- Fix for only one raid per clan showing on atk/def log by @MagicTheDev in #158
- add clan capital leaderboards by @MagicTheDev in #157
- Moved "Electro Titan" at the end of elixir troops by @rreemmii-dev in #155
- Adds new clan class fields by @MagicTheDev in #159
- If less than 10 keys exist, at least 1 key can be made, but if 10 keys… by @AumJavalgikar in #119
- huge docs restructuring by @Kuchenmampfer in #166 and #167
Full Changelog: v2.2.3...v2.3.0
Bug fix
Bug fixes
v2.2.1
Bugs Fixed:
-
Moved "Recall Spell" at the end of elixir spells (rather than end of all spells)
-
Fixed a bug with CWL where the final war can be retrieved properly on the last day as
current_war -
Fixed bug with iterators and comparing clan tags to skip wars.
This release includes:
#138 <https://github.com/mathsman5133/coc.py/pull/138>,
#139 <https://github.com/mathsman5133/coc.py/pull/139>,
#140 <https://github.com/mathsman5133/coc.py/pull/140>_,