codingame 1.0
Version 1.0
Changelog
-
Add support for asynchronous client with
Client(is_async=True)
, see the docs. -
Add support for context managers:
# synchronous with Client() as client: client.get_global_leaderboard() # asynchronous async with Client(is_async=True) as client: await client.get_global_leaderboard()
-
Remove properties like
CodinGamer.followers
in favor of methods likeCodinGamer.get_followers
to better differentiate API calls and to make it compatible with async API calls. Here's a list of all of the changed ones:Client.language_ids
->Client.get_language_ids
Client.unseen_notifications
->Client.get_unseen_notifications
CodinGamer.followers
->CodinGamer.get_followers
CodinGamer.followers_ids
->CodinGamer.get_followers_ids
CodinGamer.following
->CodinGamer.get_followed
CodinGamer.following_ids
->CodinGamer.get_followed_ids
CodinGamer.clash_of_code_rank
->
CodinGamer.get_clash_of_code_rank
-
Add more exceptions:
LoginError
regroups all the exceptions related to login:LoginRequired
,EmailRequired
,MalformedEmail
,PasswordRequired
,EmailNotLinked
andIncorrectPassword
. AndNotFound
regroupsCodinGamerNotFound
,ClashOfCodeNotFound
,ChallengeNotFound
andPuzzleNotFound
. -
Make all attributes of CodinGame models read-only.
-
Add
ChallengeLeaderboard.has_leagues
andPuzzleLeaderboard.has_leagues
. -
Add
Notification._raw
. -
Change
ClashOfCode.time_before_start
andClashOfCode.time_before_end
fromfloat
todatetime.timedelta
. -
Remove argument type validation, not my fault if you can't read the docs.
-
Rewrite the way the client works to implement a class to manage the connection state and separate the
Client
that the user uses from the HTTP client that interacts with the API.
Update
Update the module by doing pip install codingame --upgrade
Links
PyPi: https://pypi.org/project/codingame
Docs: https://codingame.readthedocs.io