Skip to main content

Wrapper for UnbelievaBoat API.

Project description

UnbelievaBoat API Python Wrapper

Discord Server Python Version PyPI Version PyPI Downloads

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unbelievaboat-2.1.1.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

unbelievaboat-2.1.1-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file unbelievaboat-2.1.1.tar.gz.

File metadata

  • Download URL: unbelievaboat-2.1.1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.0

File hashes

Hashes for unbelievaboat-2.1.1.tar.gz
Algorithm Hash digest
SHA256 f51c5c2c3e93708091a463dadddde4b50ef1635e1a4c54791bbd6be946b36e20
MD5 0767bdbd03b8c32ba2a264e76bc2a8ec
BLAKE2b-256 bfc7a92a105f7ce0deef7d00459989d8c23edbac6668812f61ed665a5947268e

See more details on using hashes here.

File details

Details for the file unbelievaboat-2.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for unbelievaboat-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0552a67f386456e40c2472e2a4a2fbb481863e314c26ea4b1c161d6ecebbd88
MD5 634b0e624c43bb2b52e190a3b0ef5e65
BLAKE2b-256 328f2aa45121f76705d671f02017eeb98e58df48294036f704c815f7a2145495

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page