Skip to content

Releases: mathsman5133/coc.py

v3.2.0

19 Dec 22:21
5e51714

Choose a tag to compare

Additions:

  • Added custom class support to a few more classes:
    • :class:ClanWarMember now supports the :attr:attack_cls attribute to customize the type returned in
      :func:ClanWarMember.attacks (and, by extension also :func:WarClan.attacks and :func:ClanWar.attacks)
    • :class:WarClan now supports the :attr:member_cls attribute to customize the type returned in
      :func:WarClan.members (and, by extension also :func:ClanWar.members)
    • :class:ClanWar now supports the :attr:clan_cls attribute to customize the types of
      :func:ClanWar.clan and :func:ClanWar.opponent
    • the :class:Equipment class can now be imported as coc.Equipment

Full Changelog: v3.1.0...v3.2.0

v3.1.0

19 Dec 20:41

Choose a tag to compare

Additions:

  • Added support for Hero Equipment:
    • an Equipment class
    • a cachedPlayer.equipment property and Player.get_equipment method. Equipment obtained this way will be enriched with game data if enabled
    • a Hero.equipment attribute to return the currently active equipment for a hero. Equipment obtained this way will never be enriched with game data and only have the basic name, level, max_level and village attributes
  • Added the new Root Rider troop
  • Added the new Spirit Fox pet
  • The ClanMember class now has a town_hall attribute that will also be present in Clan.members and Clan.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

12 Jul 16:05
4a2cc3b

Choose a tag to compare

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_wins was removed
  • :func:coc.Clan.required_builder_base_trophies was added
  • :func:coc.ClanMember.builder_base_league was added
  • :func:coc.Client.search_builder_base_leagues was added
  • :func:coc.Client.get_builder_base_league was added
  • :func:coc.Client.get_builder_base_league_named was 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_ORDER now knows the "Apprentice Warden"
  • :class:coc.SUPER_TROOP_ORDER now 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_ORDER now knows the "Electrofire Wizard"
  • :class:coc.HERO_ORDER now 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:WarLeague was replaced with :class:BaseLeague which has the same attributes, but is also used for the builder base league and the clan capital league
  • :class:League inherits from :class:BaseLeague now and adds the :attr:icon attribute which is present for home village leagues
  • :class:League lost its :attr:localized_name and :attr:localized_short_name attributes 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

18 May 19:35
26c2aba

Choose a tag to compare

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

14 May 19:11
d5f0ef7

Choose a tag to compare

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, after and limit parameters to :func:coc.Client.get_members, :func:coc.Client.get_warlog and
    :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_league and :func:coc.Client.get_capital_league_named

Changes:

  • Changed the default value of the :attr:coc.Client.throttle_limit to 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_keys or
    :func:coc.Client.login_with_tokens was used

  • Added previously missing Attribute :attr:coc.RaidAttack.stars which fixed a bug when checking
    if two :class:coc.RaidAttack objects are equal

  • Fixed a bug in :func:coc.WarEvents.new_war

  • Fixed a bug in :func:coc.Client.get_current_war which caused Exceptions or wrong return values

What's Changed (auto generated by github)

New Contributors

Full Changelog: v2.3.1...v2.4.0

v2.3.1

03 Feb 00:28
bf518c3

Choose a tag to compare

v2.3.1

  • Added back :func:coc.Client.get_location_clans_capital which was accidentally reverted in 2.3.0

  • Fixed some minor typos in the docs

What's Changed

Full Changelog: v2.3.0...v2.3.1

Big Bug fix and feature Release v2.3.0

01 Feb 20:24
a9714c4

Choose a tag to compare

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_war and ClanEvents.member_versus_rank
  • Added utility functions utils.get_clan_games_start, utils.get_clan_games_end, utils.get_raid_weekend_start and utils.get_raid_weekend_end
  • Added clan capital leaderboards
  • Added Clan.capital_points andClan.family_friendly
  • Added ClanMember.versus_rank
  • Added Client.raw_attribute to control if the new _raw_data attribute of various objects gets populated
  • Added full_war_api as an extension
  • Added Client.login_with_tokens offering the same functionality as Client.login_with_keys as 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_keys was 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.stats from collecting API response time stats
  • Fixed a bug that tried to use a cache when max_cache_size was 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!

Full Changelog: v2.2.3...v2.3.0

Bug fix

21 Dec 14:13

Choose a tag to compare

The release fixes some doc issues and the siege levels not reporting correctly. #144

Bug fixes

21 Dec 13:30

Choose a tag to compare

Merging a few PRs and Issues. Other others did not fit in this PR, so I am going to put them in their own PR.

Fixes

  • Realtime access #149
  • Add super miner #150 and #151
  • Fixed calendar issue #148
  • Fixed calculation of war attacks #146

v2.2.1

11 Nov 23:55

Choose a tag to compare

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>_,