Wrapper for UnbelievaBoat API.
Project description
UnbelievaBoat API Python Wrapper
This is a Python wrapper for the UnbelievaBoat API, which provides access to the UnbelievaBoat Discord bot functionality. It allows you to interact with the API endpoints to retrieve guild information, user balances, leaderboard data, and more.
Installation
You can install the UnbelievaBoat API Python wrapper using pip. Open your terminal and run the following command:
pip install unbelievaboat
Usage
Here's an example of how to use the UnbelievaBoat API Python wrapper to interact with the UnbelievaBoat API:
from unbelievaboat import Client
import asyncio
async def main() -> None:
# Initialize the client with your API token
client = Client("your-api-token")
guild_id = ...
user_id = ...
# Retrieve guild information
guild = await client.get_guild(guild_id)
print(guild)
# Retrieve user balance
user = await guild.get_user_balance(user_id)
print(user)
# Set or update user balance
await user.set(bank=100)
await user.update(bank=-100)
print(user)
# Close the client session
await client.close()
# You can also use async context manager
async with Client("your-api-token") as client:
leaderboard = await client.get_guild_leaderboard(guild_id)
print(leaderboard)
asyncio.run(main())
Replace "your-api-token"
with your actual API token. You can obtain an API token by logging into the UnbelievaBoat dashboard and generating a token for your bot.
Please note that the above example demonstrates a basic usage scenario. You can explore other available methods in the Client
class to interact with different API endpoints. You can also find more examples in the examples directory. For more information about the UnbelievaBoat API (data/params), please refer to the official documentation.
Requirements
- Python 3.8+
Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
License
This project is licensed under the MIT 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 Distribution
Built Distribution
File details
Details for the file unbelievaboat-2.1.2.tar.gz
.
File metadata
- Download URL: unbelievaboat-2.1.2.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a92d09c73ab2c360674a46a72418fb5c71c857728c809efee1d2fced78c13e8 |
|
MD5 | 9b74ee75429c1fb2d1ec4b8b26c197f3 |
|
BLAKE2b-256 | bd696f00518620f7ba7a93a1028bac882b3c824d11abab4c75f5d5ba0255d638 |
File details
Details for the file unbelievaboat-2.1.2-py3-none-any.whl
.
File metadata
- Download URL: unbelievaboat-2.1.2-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd5a904ed36cdd5a0bc27f8c6ab011afe28fa1d1365a995bed16584383a30e6b |
|
MD5 | db50e07e504a2712d3fdc795b757c93e |
|
BLAKE2b-256 | f50a1c297280569377d88fff448c8eefcd9132466a349810c17b542aa30e2773 |