Skip to content
Fate 怒 edited this page Mar 29, 2022 · 3 revisions

aiobungie

aiobungie is an opinionated type-safe async/await simple wrapper for Bungie's API.

Its Opinionated, Meaning you're not forced to choose RESTClient or Client or RESTPool. You can even implement your own client!

By providing core traits and interfaces, You can implement your own client from if you want. You can even use the Factory stand-alone to deserialize inventory item into a Python class for an example.

import aiobungie
import sqlite3

dummy_client = aiobungie.Client("")
factory = aiobungie.Factory(dummy_client)
db = sqlite3.connect('manifest.sqlite')
weapon = db.execute('...')
print(factory.deserialize_inventory_entity(weapon))
# <InventoryEntity(name='Thunderlord', hash=1234)>

Design

aiobungie uses the standard factory pattern design which separates the object creations from the REST. Which de-serializes the payloads into Python classes if needed.

But aiobungie also provides RESTful functionalities, i.e., RESTClient. This is the core Bungie API implementation. The place where the requests are made and the responses are returned.

Core Features

  • 95% of the API endpoints are implemented, The 5% are either not stable(PREVIEW) or other methods can achieves the same result.
  • Pythonic design using attrs.
  • Functional lazy iterators.
  • Rate-limit handling. Its also allowed to customize the amount of time to wait for the next request.
  • Automatically backing off on 5xx status code. Its also allowed to customize the amount to backoff.
  • OAuth2 functionalities.

Wiki helpers

Clone this wiki locally