Skip to content

Commit b0d643c

Browse files
committed
Bump versions to v0.1.0 and fix formatting for changelog
1 parent 5f31c78 commit b0d643c

File tree

3 files changed

+65
-60
lines changed

3 files changed

+65
-60
lines changed

coc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = '0.0.6'
3+
__version__ = '0.1.0'
44

55
from .client import Client
66
from .dataclasses import (

docs/changelog.rst

Lines changed: 63 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -10,99 +10,104 @@ v0.1.0
1010
---------
1111
BugFixes
1212
~~~~~~~~~~
13-
- Fixed bug with 'reloading' the client in the same script with
14-
loop.run_until_complete() raising runtime error
15-
- Add a more specific error `aiohttp.ContentTypeError` to be raised
16-
if trying to parse non-json response.
13+
- Fixed bug with loops breaking when reloading the client in a discord cog.
14+
- A more specific error, `aiohttp.ContentTypeError` is raised when parsing non-json responses.
1715

1816
Important
1917
~~~~~~~~~~~
18+
- Big thanks to Jab for some of these.
19+
2020
- Big one! Client now only accepts an email/password pair rather than tokens.
21-
This pair is what you use to login to https://developer.clashofclans.com/#/login
22-
and will allow the client to automatically use, create, reset and find tokens,
23-
making it a much more streamlined process.
21+
This pair is what you use to login to https://developer.clashofclans.com/#/login
22+
and will allow the client to automatically use, create, reset and find tokens,
23+
making it a much more streamlined process.
2424

25-
Big thanks to Jab for authoring a lot of this.
2625

2726
- As such, the following parameters to client have been added:
27+
2828
- ``key_count``: int: the number of tokens to rotate between when making API requests.
29-
This defaults to 1, and can be between 1 and 10
29+
This defaults to 1, and can be between 1 and 10
30+
3031
- ``key_names``: str: The name to use when creating tokens on the developer page.
31-
This defaults to `Created with coc.py Client`
32+
This defaults to `Created with coc.py Client`
3233

3334
- Email and Password are now mandatory parameters and must be passed
35+
3436
- `update_tokens` parameter has been removed. The client will automatically reset bad tokens.
3537

3638
- In order to keep consistency with the official API docs, `token` has been renamed to `key`.
37-
This affects the following method/parameters:
39+
This affects the following method/parameters:
3840

39-
``on_token_reset(new_token)`` --> ``on_key_reset(new_key)``
40-
``HTTPClient.login()`` --> ``HTTPClient.get_keys()``
41+
- ``on_token_reset(new_token)`` --> ``on_key_reset(new_key)``
42+
- ``HTTPClient.login()`` --> ``HTTPClient.get_keys()``
4143

42-
and otherwise consistent use of `key` during internals, docs, code and examples.
44+
and otherwise consistent use of `key` during internals, docs, code and examples.
4345

4446
- `pytz` and `python-dateutil` have both been removed as dependencies due to the ability to
45-
parse timestamps manually. This has been added to utils as a function: ``from_timestamp(ts)``,
46-
returning a utc-datetime object.
47+
parse timestamps manually. This has been added to utils as a function: ``from_timestamp(ts)``,
48+
returning a utc-datetime object.
4749

4850
- Dataclasses have received a makeover! Many new attributes are present, these are listed below.
49-
Most importantly, any property beginning with an underscore (_) use and return iterator objects.
50-
These are **not** lists, and relevant python documentation is here:
51-
https://docs.python.org/3/glossary.html#term-iterator. These are up to 12x faster than lists, and
52-
as such for those who are concerned about speed, performance and memory should use these, while
53-
for the majority, calling the regular property should be fine (usually returning a list rather than iter).
54-
55-
- :attr:`SearchClan._members`
56-
- :attr:`WarClan._members`
57-
- :attr:`WarClan._attacks`
58-
- :attr:`WarClan._defenses`
59-
- :attr:`WarMember._attacks`
60-
- :attr:`WarMember._defenses`
61-
- :attr:`SearchPlayer._achievements`
62-
- :attr:`CurrentWar._attacks`
63-
- :attr:`CurrentWar._members`
64-
- :attr:`LeagueClan._members`
65-
- :attr:`LeagueGroup._clans`
51+
Most importantly, any property beginning with an underscore (_) use and return iterator objects.
52+
These are **not** lists, and relevant python documentation is here:
53+
https://docs.python.org/3/glossary.html#term-iterator.
54+
55+
These are up to 12x faster than lists, and
56+
as such for those who are concerned about speed, performance and memory should use these, while
57+
for the majority, calling the regular property should be fine (usually returning a list rather than iter).
58+
59+
- :attr:`SearchClan._members`
60+
- :attr:`WarClan._members`
61+
- :attr:`WarClan._attacks`
62+
- :attr:`WarClan._defenses`
63+
- :attr:`WarMember._attacks`
64+
- :attr:`WarMember._defenses`
65+
- :attr:`SearchPlayer._achievements`
66+
- :attr:`CurrentWar._attacks`
67+
- :attr:`CurrentWar._members`
68+
- :attr:`LeagueClan._members`
69+
- :attr:`LeagueGroup._clans`
6670

6771
- The following **new** attributes were added:
6872

69-
- :attr:`SearchClan.member_dict`
70-
- :attr:`WarClan.member_dict`
71-
- :attr:`WarClan.attacks`
72-
- :attr:`WarClan.defenses`
73-
- :attr:`WarMember.attacks`
74-
- :attr:`WarMember.defenses`
75-
- :attr:`SearchPlayer.achievements_dict`
76-
- :attr:`SearchPlayer.troops_dict`
77-
- :attr:`SearchPlayer.heroes_dict`
78-
- :attr:`SearchPlayer.spells_dict`
79-
- :attr:`Timestamp.time`
73+
- :attr:`SearchClan.member_dict`
74+
- :attr:`WarClan.member_dict`
75+
- :attr:`WarClan.attacks`
76+
- :attr:`WarClan.defenses`
77+
- :attr:`WarMember.attacks`
78+
- :attr:`WarMember.defenses`
79+
- :attr:`SearchPlayer.achievements_dict`
80+
- :attr:`SearchPlayer.troops_dict`
81+
- :attr:`SearchPlayer.heroes_dict`
82+
- :attr:`SearchPlayer.spells_dict`
83+
- :attr:`Timestamp.time`
84+
8085

8186
- The folowwing **new** methods were added:
8287

83-
- :func:`SearchClan.get_member(tag)`
84-
- :func:`CurrentWar.get_member(tag)`
88+
- `SearchClan.get_member(tag)`
89+
- `CurrentWar.get_member(tag)`
8590

8691
- New utility functions:
8792

88-
- :func:`utils.get(iterable, **attrs)
93+
- `utils.get(iterable, **attrs)`
8994
- Searches the iterable until a value with the given attribute is found.
90-
Unlike ``filter()``, this will return when the first value is found.
91-
- :func:`utils.find(function, iterable)
95+
Unlike ``filter()``, this will return when the first value is found.
96+
- `utils.find(function, iterable)`
9297
- Searches through the iterable until a value which satisfies the function is found.
9398

94-
- :func:`from_timestamp(ts)`
99+
- `from_timestamp(ts)`
95100
- Parses an ISO8601 timestamp as returned by the COC API into a datetime object
96101

102+
97103
Documentation:
98-
---------------
104+
~~~~~~~~~~~~~~~~
99105
- Many docstrings were reformatted or worded, with punctuation and other typo's fixed
100106
- All new properties, attributes and methods have been documented.
101107
- Update some examples, including a `clan_info` function in discord bots (Thanks, Tuba).
102108

103109

104110

105-
106111
v0.0.6
107112
--------
108113
BugFixes
@@ -143,17 +148,17 @@ BugFixes
143148
~~~~~~~~~
144149
- Fix some problems comparing naive and aware timestamps in :class:`.Timestamp`
145150
- Add a private ``_data`` attribute to all data classes.
146-
This is the json as the API returns it. It makes ``json=True`` parameters in
147-
requests easy to handle.
151+
This is the json as the API returns it. It makes ``json=True`` parameters in
152+
requests easy to handle.
148153
- Only cache complete clan results - ie. ``Client.search_clans`` only returned a :class:`BasicClan`,
149-
so in order to add some cache consistency, cached clans now only contain :class:`SearchClan`.
154+
so in order to add some cache consistency, cached clans now only contain :class:`SearchClan`.
150155

151156
Important
152157
~~~~~~~~~~
153158
- New Class - :class:`.LeagueWarLogEntry` is similar to :class:`WarLog`, however it has it's own
154-
set of attributes to ensure it is easier to use and know which ones are present and not.
159+
set of attributes to ensure it is easier to use and know which ones are present and not.
155160
- This new class is utilised in ``Client.get_warlog``, which returns a ``list`` of both
156-
``LeagueWarLogEntry`` and ``WarLog``, depending on the war.
161+
``LeagueWarLogEntry`` and ``WarLog``, depending on the war.
157162

158163
Documentation
159164
~~~~~~~~~~~~~~
@@ -169,7 +174,7 @@ BugFixes
169174
- Fix some attributes from inherited classes not being present
170175
- Fix some :exc:`AttributeError` from being thrown due to incomplete data from API
171176
- When a clan is not in war, :class:`.WarClan` will not be present.
172-
Some errors were being thrown due to incomplete data being given from API
177+
Some errors were being thrown due to incomplete data being given from API
173178
- Allow for text-only responses from API (ie. not json)
174179

175180

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
with open(os.path.join(os.getcwd(), 'requirements.txt')) as f:
66
requirements = f.read().splitlines()
77

8-
version = '0.0.6'
8+
version = '0.1.0'
99

1010
readme = ''
1111
with open('README.rst') as f:

0 commit comments

Comments
 (0)