NOTE - this project is no longer maintained. If you are a pyroyale user, and wish to take over maintaintainership of this project, please contact me.
pyroyale
Unofficial python client for the official Clash Royale API
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.1
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python 2.7 and 3.4+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)
Then import the package:
import pyroyale
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import pyroyale
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import pyroyale
from pyroyale.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.clashroyale.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pyroyale.Configuration(
host = "https://api.clashroyale.com/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: JWT
configuration = pyroyale.Configuration(
host = "https://api.clashroyale.com/v1",
api_key = {
'authorization': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'
# Enter a context with an instance of the API client
with pyroyale.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pyroyale.CardsApi(api_client)
try:
# Get list of available cards
api_response = api_instance.get_cards()
pprint(api_response)
except ApiException as e:
print("Exception when calling CardsApi->get_cards: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://api.clashroyale.com/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| CardsApi | get_cards | GET /cards | Get list of available cards |
| ClansApi | get_clan | GET /clans/{clanTag} | Get clan information |
| ClansApi | get_clan_members | GET /clans/{clanTag}/members | List clan members |
| ClansApi | get_clan_river_race_log | GET /clans/{clanTag}/riverracelog | Retrieve clan's river race log |
| ClansApi | get_clan_war_log | GET /clans/{clanTag}/warlog | Retrieve clan's clan war log |
| ClansApi | get_current_river_race | GET /clans/{clanTag}/currentriverrace | Retrieve information about clan's current river race |
| ClansApi | get_current_war | GET /clans/{clanTag}/currentwar | Information about clan's current clan war |
| ClansApi | search_clans | GET /clans | Search clans |
| LocationsApi | get_clan_ranking | GET /locations/{locationId}/rankings/clans | Get clan rankings for a specific location |
| LocationsApi | get_clan_wars_ranking | GET /locations/{locationId}/rankings/clanwars | Get clan war rankings for a specific location |
| LocationsApi | get_location | GET /locations/{locationId} | Get location information |
| LocationsApi | get_locations | GET /locations | List locations |
| LocationsApi | get_player_ranking | GET /locations/{locationId}/rankings/players | Get player rankings for a specific location |
| PlayersApi | get_player | GET /players/{playerTag} | Get player information |
| PlayersApi | get_player_battles | GET /players/{playerTag}/battlelog | Get log of recent battles for a player |
| PlayersApi | get_player_upcoming_chests | GET /players/{playerTag}/upcomingchests | Get information about player's upcoming chests |
| TournamentsApi | get_global_tournaments | GET /globaltournaments | List global tournaments |
| TournamentsApi | get_tournament | GET /tournaments/{tournamentTag} | Get tournament information |
| TournamentsApi | search_tournaments | GET /tournaments | Search tournaments |
Documentation For Models
- Arena
- BattleLogEntry
- BattleLogTeam
- Card
- CardIconUrls
- CardList
- Chest
- ChestList
- Clan
- ClanBase
- ClanMember
- ClanMemberList
- ClanRanked
- ClanRankingList
- ClanSearchResult
- ClanSearchResultClan
- ClanWarRanked
- ClanWarsRankingList
- Error
- GameMode
- Location
- LocationList
- PlayerAchievement
- PlayerBadge
- PlayerBase
- PlayerDetail
- PlayerLeagueStatistics
- PlayerRanked
- PlayerRankingList
- RiverRace
- RiverRaceClan
- RiverRaceClanParticipant
- RiverRaceLog
- RiverRaceLogEntry
- RiverRaceStanding
- SearchPaging
- SearchPagingCursors
- SeasonStatistics
- Tournament
- TournamentDetail
- TournamentPlayer
- TournamentSearchResult
- War
- WarClan
- WarCurrent
- WarLog
- WarParticipant
- WarStanding
- WarStandingClan
Documentation For Authorization
JWT
- Type: API key
- API key parameter name: authorization
- Location: HTTP header
Author
- Aaron Traas aaron@traas.org
Development links
This project uses SonarQube for static analysis. The results of analysis are at SonarCloud. The code quality and test coverage are a work in progress.
Release files for pyroyale 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyroyale-1.0.4.tar.gz | 63.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyroyale-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 230.0 kB
Release files / pyroyale-1.0.4.tar.gz
| Download URL | pyroyale-1.0.4.tar.gz |
|---|---|
| Size | 63.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7fe7eae246867746edea853cd1d2c2c68079bf3aff13ce9289eecc51ffd6408
|
|
BLAKE2b-256 checksum How to use checksums |
d84e155d1044347feacd64452979da5853f336e402c4573dcdf37b78274459b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3
|
Release files / pyroyale-1.0.4-py3-none-any.whl
| Download URL | pyroyale-1.0.4-py3-none-any.whl |
|---|---|
| Size | 166.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03804a1515649f4e8e130164329a6d89cf527935f43f2ac8e2feb7eaae4c99d7
|
|
BLAKE2b-256 checksum How to use checksums |
299e8a62940ee703329455986bd8def256301dcc032c0ccadc619e49c800708d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3
|