A small async api wrapper for the bungie api
Project description
Key Features
- Fully Asynchronous.
- Simplicity.
- Efficient and optimized.
- Statically typings and annotations.
- All endpoints will be implemented.
Installing
Official release.
$ pip install aiobungie
Development
$ pip install git+https://github.com/nxtlo/aiobungie
Quick Example
import aiobungie
client = aiobungie.Client(key='YOUR_API_KEY')
async def main() -> None:
# fetch a clan from its id.
clan = await client.fetch_clan_from_id(1234)
# or fetch the clan by its name
clan = await client.fetch_clan("Fast")
print(f'{clan.id}, {clan.name}, {clan.owner}, {clan.created_at}, {clan.about}')
# fetch a destiny 2 player.
player = await client.fetch_player('Fate怒')
print(f'{player.name}, {player.id[0]}, {player.icon}, {player.type}')
# fetch a specific character.
char = await client.fetch_character(player.id[0], aiobungie.MembershipType.STEAM, aiobungie.Class.WARLOCK)
print(f'{char.emblem}, {char.light}, {char.id}, {char.race}, {char.gender}, {char._class}')
# fetch activities.
activ = await client.fetch_activity(player.id[0], char.id, aiobungie.MembershipType.STEAM, aiobungie.GameMode.RAID)
print(
f'''{activ.mode}, {activ.kills}, {activ.player_count},
{activ.duration}, {activ.when}, {activ.kd}, {activ.deaths},
{activ.assists}, {activ.hash} -> raids only {activ.raw_hash} -> Any
''')
# Raw search
endpoint = await client.from_path('User/.../.../')
print(endpoint)
client.loop.run_until_complete(main())
Requirements
- Python >=3.8 -> Required.
- aiohttp -> Required for http.
- aredis -> Optional for cache.
- attrs -> Class attrs.
Getting Help
- Discord:
Fate 怒#0008
|350750086357057537
- Docs: Here.
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
aiobungie-0.2.5b4.tar.gz
(31.0 kB
view hashes)
Built Distribution
Close
Hashes for aiobungie-0.2.5b4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ed3571ffd0ad42ae31bc022af837d0358735043022b165566d6841b42e30416 |
|
MD5 | 4f876b5a3e8d8f26610a3ff63f0864e9 |
|
BLAKE2b-256 | e26729b9f33f8d9251e2b38d5dbb2d7f7c0ef60ce999ba75d8d7c9aced0c7efa |