Asynchronous wrapper for UnbelievaBoat's API written in python
Project description
unbelip
Asynchronous wrapper for UnbelievaBoat's API written in python
Characteristics
- Easy to use
- Full error handling
- Type hinted and readable code
Project status
Early alpha and as such unsuitable for production.
Installation
pip install unbelipy
Use:
from unbelipy import UnbeliClient
import asyncio
TOKEN = "Token generated through Unbelievaboat's portal"
client = UnbeliClient(token=TOKEN)
async def main():
# get guild information
guild_info = await client.get_guild(guild_id=305129477627969547)
# get guild leaderboard
guild_leaderboard = await client.get_leaderboard(guild_id=305129477627969547)
# get user balance
balance = await client.get_balance(guild_id=305129477627969547, member_id=80821761460928512)
# put balance (set to x amount)
balance = await client.set_balance(guild_id=305129477627969547,
member_id=80821761460928512,
cash=1000,
reason="Showing off put method")
# patch balance (increment or decrement by x amount)
balance = await client.edit_balance(guild_id=305129477627969547,
member_id=80821761460928512,
cash=-500,
reason="Showing off patch method")
"balance" is a returned Dataclass with balance information containing:
- total: total amount of currency (cash + bank)
- bank: amount in bank
- cash: amount in cash
- user_id: id of the user for which the amount is set
- guild_id: id for the guild the user belongs to
- rank: rank of the user in the guild according to query parameters
"guild_info" is a dataclass with guild info containing:
- id
- name
- icon
- owner_id
- member_count
- symbol (currency)
UnbeliClient also has a rate_limit_data attribute with information returned with each request from the API.
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
unbelipy-0.0.1a1.tar.gz
(6.3 kB
view details)
Built Distribution
File details
Details for the file unbelipy-0.0.1a1.tar.gz
.
File metadata
- Download URL: unbelipy-0.0.1a1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.8.8 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53cc9b64fd74ad6c7afa37da831968de8873bbbcc43b1068f8f5a351ffde3287 |
|
MD5 | c5bb0c39153f2c23bc368e9fd59ef55c |
|
BLAKE2b-256 | 1fc7a2dc9cc26cad4f3de0b9bea65e347a01d6fb190b8fd88edea70a0c260965 |
File details
Details for the file unbelipy-0.0.1a1-py3-none-any.whl
.
File metadata
- Download URL: unbelipy-0.0.1a1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.8.8 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 878605def02afe66c9cf2ea85e1880741c5e48e9612fac579dcd5b43c833d66f |
|
MD5 | 098fa4bc5d6a29288809a811fbeb64c9 |
|
BLAKE2b-256 | 4402fc890d556bd138ad17daf93ecdddb388ad495ec7ce78b375c1f810401d2c |