Skip to main content

A python wrapper for the Clash of Clans API

Project description

coc.py

Easy to use asynchronous Clash of Clans API wrapper in Python.

Key Features

  • Asynchronous code

  • Entire coverage of the official Clash of Clans API

  • Auto updating tokens for use with dynamic IPs

Getting Started

Installing

Python 3.5 or higher is required

# Linux/OS X
python3 -m pip install -U coc.py

# Windows
py -3 -m pip install -U coc.py

Quick Example

import coc
import asyncio

client = coc.Client('token')

async def get_some_player(tag):
    player = await client.get_player(tag)

    print(player.name)
    # alternatively,
    print(str(player))

async def get_five_clans(name):
    players = await client.search_clans(name=name, limit=5)
    for n in players:
        print(n, n.tag)

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(get_some_player('tag'))
    loop.run_until_complete(get_five_clans('name')

For more examples see the examples directory

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coc.py-0.0.6.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coc.py-0.0.6-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file coc.py-0.0.6.tar.gz.

File metadata

  • Download URL: coc.py-0.0.6.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

File hashes

Hashes for coc.py-0.0.6.tar.gz
Algorithm Hash digest
SHA256 d961ceeca564bf2f3c5105caf454bfcc7f63727e28320d4d0c4f07dcf0c643c0
MD5 25a79ec6d881f3ced950fd1b4c5eee30
BLAKE2b-256 7cf01ac2a04c7b4790be04aaeda11739bfae02a1eea69a5257e4af9cdb9f3a4f

See more details on using hashes here.

File details

Details for the file coc.py-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: coc.py-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

File hashes

Hashes for coc.py-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5c8aa048ae815eff72ddffed518bb0a8e9c6730f468855e2d688ce06c426a9c9
MD5 2d62a673bb60703da5f0629d0d8c387a
BLAKE2b-256 a27fa6eaeda453c36828382a387567b07cd53f82a6b7b475c735896729686777

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page