I'm trying to get started using your wrapper and ran in to an error in the aiohttp library when attempting to run a copy of your sync.py code. Here is what I ran and the full error output:
example code I ran:
import clashroyale
import os
# Basic functionality
token = os.getenv('crtoken') # get your developer key somehow.
client = clashroyale.Client(token)
profile = client.get_player('#8l9l9gl') # library cleans the tag (strips #)
print(repr(profile))
print(profile.name)
# Access data via dot notation.
print(profile.stats.favorite_card.name)
# Access API data via snake_case instead of camelCase
# Everything is exactly the same as what is
# presented in the official API documentation
#
# {
# "stats": {
# "favoriteCard": {
# "name": "P.E.K.K.A"
# },
# ...
# },
# ...
#
profile.refresh()
# Refresh model data, This means that the
# data will be requested again from the api
clan = profile.get_clan() # Request the clan object associated with the profile
print(clan)
print(clan.clan_chest) # dot notation
clan.refresh() # Refresh clan data
member = clan.members[0] # get the member object of the top member
assert member.clan is clan # Keeps a reference to the clan
assert member.rank == 1
# This member object only contains a brief amount of data
full_player = member.get_profile() # member.get_player() is also an alias
# This function requests the full player data using the members tag.
# Getting multiple clans/profiles
clans = client.get_clans('2CCCP', '2U2GGQJ') # indefinite amount of arguments
for clan in clans:
print(clan.members[0])
filtered = client.get_clan('2cccp', keys=['name', 'tag']) # Filtering with keys= and exclude=
print(filtered.raw_data)
print(client.get_player('2P0LYQ', keys='battles').raw_data.keys()) # battles
print(client.get_auth_stats())
error output:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-96e0835f5755> in <module>()
----> 1 import clashroyale
2 import os
3
4 # Basic functionality
5 token = os.getenv('crtoken') # get your developer key somehow.
~/anaconda3/lib/python3.6/site-packages/clashroyale/__init__.py in <module>()
23 '''
24
---> 25 from .client import Client
26 from .errors import *
27 from .models import *
~/anaconda3/lib/python3.6/site-packages/clashroyale/client.py in <module>()
29 from urllib.parse import urlencode
30
---> 31 import aiohttp
32 import requests
33
~/anaconda3/lib/python3.6/site-packages/aiohttp/__init__.py in <module>()
4
5 from . import hdrs # noqa
----> 6 from .client import * # noqa
7 from .formdata import * # noqa
8 from .helpers import * # noqa
~/anaconda3/lib/python3.6/site-packages/aiohttp/client.py in <module>()
13 from yarl import URL
14
---> 15 from . import connector as connector_mod
16 from . import client_exceptions, client_reqrep, hdrs, http, payload
17 from .client_exceptions import * # noqa
~/anaconda3/lib/python3.6/site-packages/aiohttp/connector.py in <module>()
15 ClientProxyConnectionError,
16 ServerFingerprintMismatch)
---> 17 from .client_proto import ResponseHandler
18 from .client_reqrep import ClientRequest
19 from .helpers import SimpleCookie, is_ip_address, noop, sentinel
~/anaconda3/lib/python3.6/site-packages/aiohttp/client_proto.py in <module>()
4 from .client_exceptions import (ClientOSError, ClientPayloadError,
5 ServerDisconnectedError)
----> 6 from .http import HttpResponseParser, StreamWriter
7 from .streams import EMPTY_PAYLOAD, DataQueue
8
~/anaconda3/lib/python3.6/site-packages/aiohttp/http.py in <module>()
6 from . import __version__
7 from .http_exceptions import HttpProcessingError
----> 8 from .http_parser import (HttpParser, HttpRequestParser, HttpResponseParser,
9 RawRequestMessage, RawResponseMessage)
10 from .http_websocket import (WS_CLOSED_MESSAGE, WS_CLOSING_MESSAGE, WS_KEY,
~/anaconda3/lib/python3.6/site-packages/aiohttp/http_parser.py in <module>()
13 ContentLengthError, InvalidHeader, LineTooLong,
14 TransferEncodingError)
---> 15 from .http_writer import HttpVersion, HttpVersion10
16 from .log import internal_logger
17 from .streams import EMPTY_PAYLOAD, FlowControlStreamReader
~/anaconda3/lib/python3.6/site-packages/aiohttp/http_writer.py in <module>()
302
303
--> 304 class URL(yarl.URL):
305
306 def __init__(self, schema, netloc, port, path, query, fragment, userinfo):
~/anaconda3/lib/python3.6/site-packages/yarl/__init__.py in __init_subclass__(cls)
230 def __init_subclass__(cls):
231 raise TypeError("Inheritance a class {!r} from URL "
--> 232 "is forbidden".format(cls))
233
234 def __str__(self):
TypeError: Inheritance a class <class 'aiohttp.http_writer.URL'> from URL is forbidden
I'm trying to get started using your wrapper and ran in to an error in the aiohttp library when attempting to run a copy of your sync.py code. Here is what I ran and the full error output:
example code I ran:
error output:
here is a list from my conda environment:
Do you notice any obvious dependency issues? Can you suggest how to troubleshoot this problem otherwise?