All Projects → nxtlo → aiobungie

nxtlo / aiobungie

Licence: MIT license
Python and asyncio Bungie API wrapper.

Programming Languages

python
139335 projects - #7 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to aiobungie

node-destiny-2
🌑 A zero dependency Destiny 2 API wrapper written in Node.js
Stars: ✭ 23 (-28.12%)
Mutual labels:  bungie-api, bungie-destiny-api
the-traveler
The Traveler is a small npm package which wraps around the Destiny 2 API.
Stars: ✭ 52 (+62.5%)
Mutual labels:  bungie-api, destiny2
wishlist
The wishlist has moved! Head on over to https://github.com/rslifka/sliflist
Stars: ✭ 14 (-56.25%)
Mutual labels:  destiny2
fate of all fools
Enhancements to the information presented in DIM for Destiny 2
Stars: ✭ 20 (-37.5%)
Mutual labels:  destiny2
destiny-macros
A collection of Destiny 2 macros built with AutoHotKey
Stars: ✭ 24 (-25%)
Mutual labels:  destiny2
dcli
Command line utilities for Destiny 2
Stars: ✭ 49 (+53.13%)
Mutual labels:  destiny2

aiobungie

A statically typed API wrapper for the Bungie's REST API written in Python3 and Asyncio.

Installing

PyPI stable release.

$ pip install aiobungie

Development

$ pip install git+https://github.com/nxtlo/aiobungie@master

Quick Example

See Examples for advance usage.

import aiobungie

client = aiobungie.Client('YOUR_API_KEY')

async def main() -> None:

    # Fetch a charatcer with all its components.
    # This includes Equimpents, Inventory, Records, etc.
    async with client.rest:
        my_warlock = await client.fetch_character(
            membership_id,
            aiobungie.MembershipType.STEAM,
            character_id,
            components=[aiobungie.Component.ALL_CHARACTERS]
        )

        for activity in my_warlock.activities:
            # Check if activity is a raid.
            if activity.current_mode and activity.current_mode is aiobungie.GameMode.RAID:
                print(activity.avaliable_activities) # All raids for this character.

# You can either run it using the client or just asyncio.run(main())
client.run(main())

RESTful clients

Alternatively, You can use RESTClient which's designed to only make HTTP requests and return JSON objects. and to interact with the manifest.

Example

import aiobungie
import asyncio

# Single REST client connection.
client = aiobungie.RESTClient("...")

async def main() -> None:
    async with client:
        # SQLite manifest.
        await client.download_manifest()

        # OAuth2 API.
        tokens = await client.fetch_oauth2_tokens('code')

asyncio.run(main())

Requirements

  • Python 3.9 or higher
  • aiohttp
  • attrs

Contributing

Please read this manual

Getting Help

  • Discord: Fate 怒#0008 | 350750086357057537
  • Docs: Here.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].