Skip to content
This repository was archived by the owner on Aug 19, 2018. It is now read-only.

Commit f1c0d17

Browse files
committed
Added a setup.py and examples
1 parent 5161ced commit f1c0d17

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

examples/example.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Inside an async function
2+
3+
import crasync
4+
import asyncio
5+
6+
async def main():
7+
client = crasync.Client()
8+
profile = await client.get_profile('2CYUUCC8')
9+
10+
print(profile)
11+
print(profile.current_trophies)
12+
13+
await asyncio.sleep(5)
14+
await profile.update() # updating the info
15+
16+
clan = await profile.get_clan() # get the players full clan info
17+
18+
print(clan)
19+
print(len(clan.members))
20+
21+
await asyncio.sleep(5)
22+
await clan.update() # updating the info
23+
24+
highest = await clan.members[0].get_profile()
25+
26+
print(highest) # top player
27+
28+
29+
loop = asyncio.get_event_loop()
30+
loop.run_until_complete(main())
31+

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[metadata]
2+
description-file = README.md

setup.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from distutils.core import setup
2+
3+
setup(
4+
name='crasync',
5+
packages=['crasync'], # this must be the same as the name above
6+
version='v1.0.0a',
7+
description='An async wrapper for cr-api.com',
8+
author='verixx',
9+
author_email='[email protected]',
10+
url='https://github.com/grokkers/cr-async', # use the URL to the github repo
11+
download_url='https://github.com/grokkers/cr-async/archive/v1.0.0-alpha.tar.gz', # I'll explain this in a second
12+
keywords=['clashroyale'], # arbitrary keywords
13+
classifiers=[],
14+
)

0 commit comments

Comments
 (0)