BSDotPy, A module to get a bombsquad player's account data.
Project description
BSDotPy
BSDotPy, A module to get a bombsquad player's account data from bombsquad's servers.
Badges
Provided By: shields.io
Acknowledgements
Authors
Installation
Easiest way is to install bsdotpy with pip
pip install -U bsdotpy
Usage / Examples
As mentioned in the bombsquad's server builds, you might need to show stats of the players playing in your server's website, instead of using http://bombsquadgame.com/accountquery?id={YOUR_UNIQUE_ID}
api and manually reformating the data, you can use this api wrapper to do everything for you automatically. Currently, the below four parameters are returned by API.
To get your account id, enter 'getaccountid' in BombSquad Application's Settings -> Advanced -> Enter Code.
from bsdotpy import BombSquadServer
server = BombSquadServer() # Instantiates a BombSquadServer object which will interact with bombsquad's server.
unique_id = "pb-IF4rVEQCKg==" # Unique ID must be valid else an error will be thrown
player = server.get_player_data(unique_id) # Returns a bsdotpy.BombSquadPlayer object
print(player.name) # Prints the player's name returned by bombsquad server's api
>>> '꧁༒Firͥe Heͣaͫd༒꧂'
print(player.unique_id) # Prints unique id of the player
>>> 'pb-IF4rVEQCKg=='
print(player.icon_url) # Prints the url to the icon the player has
>>> 'http://bombsquadgame.com/img/char/30.png'
print(player.created_at) # Prints a datetime.datetime object of when the player was created
>>> 2020-02-17 17:10:50
print(repr(player)) # Prints the class object representation of the BombSquadPlayer object
>>> <BombSquadPlayer unique_id='pb-IF4rVEQCKg==', name='꧁༒Firͥe Heͣaͫd༒꧂', icon_url='http://bombsquadgame.com/img/char/30.png', created_at='2020-02-17 17:10:50'>
Contributing
Contributions are always welcome!
- Fork this repository.
- Make the changes in your forked repositry.
- Make sure to fetch upstream before generating a PR.
- Generate a pull request.
Please adhere to the GitHub's code of conduct
for contributions and contributors.
License
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file bsdotpy-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: bsdotpy-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff064580c19771ba1c2a8c44fa919faa9166dd2d14e831813fe662c0f219d684 |
|
MD5 | f35a18f425ecfed22ac7ae3d94c34b11 |
|
BLAKE2b-256 | 8ce3020e3a0cf4658609a588b77348f35b1b403477bc932ea737413e92f799c5 |