Skip to main content

A basic API wrapper for Clash Royale.

Project description

https://raw.githubusercontent.com/Ombucha/clashroyale.py/main/banner.png PyPI version PyPI downloads Lines of code Repository size

A modern, easy-to-use, and feature-rich Python wrapper for the Clash Royale API.

Features

  • Full support for all Clash Royale API endpoints

  • Event-driven architecture (with decorators)

  • Pythonic models for all objects (players, clans, tournaments, etc.)

  • Built-in error handling and rate limit management

  • Type hints for all public interfaces

  • Actively maintained and open source

Requirements

Installation

Stable version:

# Unix / macOS
python3 -m pip install "clashroyale.py"

# Windows
py -m pip install "clashroyale.py"

Development version:

git clone https://github.com/Ombucha/clashroyale.py

Getting Started

import clashroyale as cr

client = cr.Client("token")

# Fetch a player by tag
player = client.get_player("#URUGP8G0")
print(f"{player.name}: {player.trophies} trophies")

# Fetch a clan and its members
clan = client.get_clan("#Q9LYC0YL")
print(f"Clan: {clan.name} ({clan.tag})")
for member in clan.member_list:
    print(f"{member.name} - {member.trophies} trophies")

# Get top 5 global players
top_players = client.get_player_rankings("global", limit=5)
for player in top_players:
    print(f"{player.rank}. {player.name} - {player.trophies} trophies")

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

clashroyale_py-1.0.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

clashroyale_py-1.0.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file clashroyale_py-1.0.0.tar.gz.

File metadata

  • Download URL: clashroyale_py-1.0.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for clashroyale_py-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9cfc5a88a26a37ea0c7d6910b95ce0f3dc5722ce69866150bcb6413a8e1d5507
MD5 da1579b3d185695c6ce5c787fe2c16f5
BLAKE2b-256 c620b2cbbb0874296aaa620686b0f0c9fe4710d4b540cb23ec85dbd9d12926f7

See more details on using hashes here.

File details

Details for the file clashroyale_py-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: clashroyale_py-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for clashroyale_py-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 586b5055d3644b1e0c9c8d8cf2a57a212301528b73bb59c50d44c258bac0e1a5
MD5 4aedc4e11568633e6d8dc334cdef5332
BLAKE2b-256 f13176b3abba524df4a07c5bd56b70b901fd98d49bb636e8a1ea1b2071669e1d

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