coc.py to clashy.py
Most of the outward facing library is the same, with a few changes detailed below. Significant changes are caused by a large static data update, support for army recipes, and a bump to 3.10 minimum python version.
Static Data
Static data is now always loaded into the client for use with coc.Client.parse_army_link(),
coc.Client.parse_account_data(), & other static data relying functions. Injection into coc.Troop,
coc.Hero, and other item classes still only happens when set to do so.
The function coc.Client.create_army_link() was removed.
The changes to coc.Troop and similar classes are minor, but some attributes may be different:
different typing (like from
strtococ.enums.VillageType)new attributes (like
coc.Spell.duration)removed attributes (like
coc.Troop.training_time)
Consult the docs to see what has changed. The documentation has been vastly improved to include both new & missing info.
New Classes/Functions
coc.ArmyRecipefor use with parsed army links (coc.Client.parse_army_link())coc.AccountDatafor use with parsed account data (coc.Client.parse_account_data())coc.StaticDatafor use with parsed static data (can be accessed viacoc.Client.static_data)coc.Translationfor translations of item names & descriptions (coc.Client.get_translation())coc.ExtendedCWLGroupfor group CWL medal & promotion data (coc.Client.get_extended_cwl_group_data())coc.Building,coc.Trap,coc.Guardian,coc.Helper,coc.Scenery,coc.Skin,coc.Decoration,coc.Obstacleandcoc.ClanCapitalHousePartadded for use with parsed static datacoc.utils.get_season_start()&coc.utils.get_season_end()now have a legacy parameter to allow for the old season start/end method. Previously season start/end was calculated based on the last Monday of the month, but now it is calculated based on the first Monday of the month.
Constant/Enums
Coc.py game data was updated and now includes all the recently added troops & heros. Any lists that used to be
in coc.enums now reside in coc.constants. Internally these constants are now dynamically generated from static
data to ensure consistent & easy updates. Additionally, the following were added:
coc.Resourceupdated with new Resource typescoc.SceneryTypeaddedcoc.EquipmentRarityaddedcoc.SkinTieraddedcoc.Genderaddedcoc.BuildingTypeadded