Releases: mathsman5133/coc.py
v2.0.1
-
New achievements for clan capital
-
Switched to using Tuba's new links API (Thanks, Tuba)
-
Get the IP Address from logging into the developer site to save an API call (Thanks, Roshan)
v2.0.0
Migrating to coc.py v2.0
Most of the outward facing library is the same, with a few changes detailed below. One significant change is the
introduction of game data into Troop, Spell, Hero and Pet objects. You can read more about that here: :ref:game_data
.
Logging in with keys
A popular request was made to be able to use the client without the automatic key management. You can now initiate coc.py
with a list of keys (or tokens), using the :meth:coc.login_with_keys
method.
Parsing and creating army links
The June update brought about the ability to share and create army links. v2 brings the ability to do this within the client,
using the methods :meth:Client.parse_army_link
and :meth:Client.create_army_link
. These work best when paired with
the game data mentioned above, as you will receive (semi)complete Troop and Spell objects with stats for all troops and spells.
Thanks to Anub, Sco and others for helping to implement this.
Additional methods / attributes for models
A popular feature request was to be able to know "is this troop the max for the player's TH level". Before, this would
require you to keep a static list of troop levels and do a lookup. This has been integrated into coc.py, and many models
have this attribute now:
-
:attr:
Troop.is_max_for_townhall
-
:attr:
Spell.is_max_for_townhall
-
:attr:
Hero.is_max_for_townhall
-
:attr:
Pet.is_max_for_townhall
Similarly, you can use Troop.get_max_level_for_townhall
to do the opposite - get the max troop level for a specific townhall.
More on that in the :ref:game_data
section, however.
-
:attr:
WarClan.average_attack_duration
is now a valid property, thanks to doluk for implementing this. -
:attr:
Player.war_opted_in
was added, to reflect the September update in the API. -
:attr:
ClanWar.attacks_per_member
was added, which details the number of attacks each member has in the war, also in the September update. -
:attr:
Player.clan_previous_rank
was fixed, it didn't point to the correct API field before.
Miscellaneous
-
ujson
has been added to the requirements and will be used where possible,
as a faster method of deserialising json payloads from the API. -
Internal handling of keys has been written to make it more stable.
-
Flame Flinger, Super Bowler and Super Dragon were all added to coc.py.
v1.3.0
v1.3.0
-
Added Dragon Rider and Rocket Balloon
-
Added
cls
parameter for :meth:Clan.get_detailed_members()
-
Troops no longer included in
Player.home_troops
-
:exc:
InvalidArgument
will now return a more helpful message. -
limit
parameter is now correctly cached when usingsearch_x
endpoints. -
Added more typings and documentation improvements
v1.2.1
v1.2.1
- Fixes an issue where
Clan.members
was empty ifClan.get_member
was called beforeClan.members
.
There was a similar issue withPlayer.heroes
andPlayer.spells
.
v1.2.0
v1.2.0
-
Adds new achievements and updated the order of existing ones.
-
Added :attr:
Player.super_troops
and :attr:Player.pets
. -
Added :attr:
Troop.is_active
to check whether a super troop is active. -
Added :attr:
WarAttack.duration
-
Added :attr:
Clan.chat_language
which is a :class:ChatLanguage
object. -
Fixed errors when coc.py tried to parse 5xx (e.g. 502) errors as HTML when they were dicts.
-
Improved docs for :attr:
RankedPlayer.previous_rank
.
v1.1.0
-
Adds support for the new Player API verification endpoint - see :meth:
Client.verify_player_token
-
Fixes a bug where members in
clan.get_detailed_members()
wouldn't have theclan_rank
attribute, for example::before
async for member in clan.get_detailed_members():
print(member.clan_rank) # prints "None"after
async for member in clan.get_detailed_members():
print(member.clan_rank) # prints "1" or "10" or their clan rank. -
Fixes a bug where getting the warlog failed for clans with (>3yr) old war logs. See #72
-
Fixed docs for :attr:
Player.clan_previous_rank
since it was misleading before.
v1.0.4
v1.0.4
Support aiohttp v3.7
Add retry handling to the HTTPClient - if a request fails with a GatewayError (or TimeoutError), it will sleep and then retry for a maximum of 5 times.
Super Minion, Super Wizard, Ice Hound, Log Launcher and Invisibility Spells were added.
v1.0.3
v1.0.3
-
Fixed an issue where the HTTP cache layer was not being utilised.
-
Fixed an issue where :meth:
utils.get_season_start
and :meth:utils.get_season_end
got the previous season information
if the system time had not yet passed 5am UTC.
v1.0.2
v1.0.2
-
Fixed an issue where hitting Maintenance errors when using the normal Client would raise an Attribute Error.
-
Fixed an issue where using
Clan.get_member
without callingClan.members
would build an incorrect player lookup dict. -
Fixed an issue where events wouldn't start because the maintenance event wasn't set properly.
v1.0.1
v1.0.1
-
Maintenance event poller logic has been reworked to enable the use of :class:
EventsClient
without any player/clan/war
updates. -
5min preparation time has been included in the list of valid prep times for friendly wars.
-
The warlog example has been updated to properly close the client, and a typo fixed in the README example.
-
The
correct_tags
parameter has been changed to default toTrue
. There is no side-effects of having this enabled.