Skip to main content

A small async api wrapper for the bungie api

Project description

aiobungie

An Asynchronous API wrapper for the bungie API witten in Python.

Installing

pip install aiobungie

Quick Example

import aiobungie

# Without classes.

client = aiobungie.Client(key='YOUR_API_KEY')

async def player(name):
    _player = await client.get_player(name)
    print(_player.name)
    print(_player.icon_path)
    print(_player.id)
    print(_player.type)

client.loop.run_until_complete(player("Sweatcicle"))

# With classes

class PlayerTest(aiobungie.Client):
    def __init__(self):
        super().__init__(key='YOUR_API_KEY')

    async def player_data(self, player_name: str):
        player = await self.get_player(player_name)

        try:
            print(player.name)
            print(player.type)
            print(player.id)
            print(player.icon_path)
        except:
            pass

if __name__ == '__main__':
    plr = PlayerTest()
    plr.loop.run_until_complete(plr.player_data("DeeJ"))

Requirements

  • httpx

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

aiobungie-0.2.0.tar.gz (8.8 kB view hashes)

Uploaded Source

Built Distribution

aiobungie-0.2.0-py3-none-any.whl (18.4 kB view hashes)

Uploaded Python 3

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