A basic API wrapper for Brawl Stars.
Project description
Requirements
This module requires the following modules:
Installation
Python 3.8 or higher is required.
To install the stable version, do the following:
# Unix / macOS
python3 -m pip install "brawlstars.py"
# Windows
py -m pip install "brawlstars.py"
To install the development version, do the following:
$ git clone https://github.com/Infiniticity/brawlstars.py
Quick Example
import brawlstars as bs
client = bs.Client("token")
player = client.get_player("#9PPUP2CJ")
print(player.trophies)
print(player.team_victories)
club = client.get_club(player.club.tag)
if club is not None:
members = client.get_club_members(club.tag)
best_player = max(members, key = lambda member: member.trophies)
print(best_player.name, f"- {best_player.trophies} 🏆")
player_rankings = client.get_player_rankings("global", limit = 5)
for player in player_rankings:
print(f"{player.rank}. {player.name}")
brawler_rankings = client.get_brawler_rankings("us", 16000043, limit = 10)
for player in brawler_rankings:
print(f"{player.rank}. {player.name}")
battles = client.get_player_battlelog("#JGCCGY80")
print(battles[0].battle.mode)
More examples can be viewed in the examples folder.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
brawlstars.py-1.1.0.tar.gz
(7.6 kB
view details)
Built Distribution
File details
Details for the file brawlstars.py-1.1.0.tar.gz
.
File metadata
- Download URL: brawlstars.py-1.1.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a84189adfc4c74cb4ccad5b93fb6c07dd9a4861d29584541c1d93c72ddb26255 |
|
MD5 | 8301f8d385a04a76dabd339960edd88c |
|
BLAKE2b-256 | 20a153182bfbe287765120be5eb196743c3778551011db675b9ff28687602614 |
File details
Details for the file brawlstars.py-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: brawlstars.py-1.1.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05ee472444f6d8b7e9ed236c37b7e5fe1450a2c052b8c1af460df017ba45776b |
|
MD5 | f3317f20fc0398731baa7693a842c8f5 |
|
BLAKE2b-256 | aabe42959b0d1bef32bbf8a13470e7e1ed203d6281489a51f02c0309e2ebfc49 |