https://github.com/nxtlo/aiobungie

Python and asyncio Bungie API wrapper.

https://github.com/nxtlo/aiobungie

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary

Keywords

aiobungie bungie-api bungie-destiny-api destiny2 hacktoberfest python3

Keywords from Contributors

sequences projection interactive serializer measurement cycles packaging charts network-simulation archival
Last synced: 6 months ago · JSON representation

Repository

Python and asyncio Bungie API wrapper.

Basic Info
Statistics
  • Stars: 55
  • Watchers: 1
  • Forks: 9
  • Open Issues: 1
  • Releases: 31
Topics
aiobungie bungie-api bungie-destiny-api destiny2 hacktoberfest python3
Created about 5 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Codeowners

README.md

aiobungie

An ergonomic, statically typed, asynchronous API wrapper that supports Bungie's REST API for Python 3.

aiobungie is built to be extensible and reusable, allowing its users to freely switch parts of core implementations with their own incase of future circumstances.

Installing

Currently Python 3.10, 3.11, 3.12 and 3.13 are supported.

Stable pip.

sh pip install aiobungie

unstable releases via GitHub master.

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

Quick Look

See Examples for advance usage.

```py import aiobungie import asyncio

client = aiobungie.Client('YOURAPIKEY')

async def main() -> None: # Search for Destiny 2 players. async with client.rest: users = await client.search_users("Fate")

  for user in users:
    # Print all Destiny 2 memberships for this user.
    print(user.memberships)

asyncio.run(main()) ```

RESTful clients

aiobungie also provides a stand-alone RESTClient / RESTPool clients which are the foundation of Client, These clients just provide a lower-level abstraction.

a Client based user may access the RESTClient instance bound to it with .rest property.

Example

```py import aiobungie import asyncio

Single REST client connection.

client = aiobungie.RESTClient("YOURAPIKEY")

async def main() -> None: async with client: # Download and open the JSON manifest. manifest = await client.downloadjsonmanifest(name="latest_manifest") with manifest.open("r") as file: data = file.read()

    # two simple methods for fetching and refreshing tokens.
    tokens = await client.fetch_oauth2_tokens('code')
    refreshed_tokens = await client.refresh_access_token(tokens.refresh_token)

    # making your own requests.
    response = await client.static_request(
        "GET", # Method.
        "Destiny2/path/to/route", # Route.
        auth="optional_access_token", # If the method requires OAuth2.
        json={"some_key": "some_value"} # If you need to pass JSON data.
    )

asyncio.run(main()) ```

When to use which?

  • Use Client when:
    • You want a high-level interface.
    • You're building a Bot, i.e, Discord Bot, Chat Bot.
    • You're building a CLI tool.
    • In a single script file.
  • Use RESTClient when:
    • You want an interface similar to Client but with extra functionalities.
    • You want raw JSON responses instead of data-classes.
    • You want REST API functionalities.
    • You want full ownership of the requests/responses.
  • Use RESTPool when:
    • everything RESTClient provides.
    • You want to spawn multiple RESTClients.
    • You're building a distributed backend.

Dependencies

  • aiohttp
  • attrs
  • sain, this is a dependency free utility package.
  • backports.datetime_fromisoformat, required for Python 3.10 only.

Features

aiobungie features are extra dependencies that replaces the standard library with either faster/neater pkgs.

  • speedup This will include and use orjson as the default json parser. It provide faster JSON serialization and de-serialization than the standard Python JSON pkg.
  • full: This will include all of the features above.

For installing the specified feature, type pip install aiobungie[feature-name]

Optimizations

  • runtime-assertion: You can disable runtime assertions by passing a -O flag python app.py -O, the API responses won't get asserted at runtime which may boost the return speeds by a bit.
  • uvloop (unix systems only): uvloop is an ultra-fast drop in replacement library for the built-in asyncio event loop.

Contributing

Please read this manual

Related Projects

If you have used aiobungie and want to show your work, Feel free to Open a PR including it.

  • Fated: A Discord BOT that uses aiobungie.

Useful Resources

  • Discord Username: vfate
  • aiobungie Documentation: Here.
  • BungieAPI Discord: Here
  • Official Bungie Documentation: Here
  • Bungie Developer Portal: Here

Notes

  • If you need help with something related to this project: Consider opening a blank issue, discussion or checkout the useful resources above.
  • aiobungie doesn't support X update, what now? aiobungie's REST client has a method called static_request which allows you to make your own requests, check out examples/custom_client example.
  • aiobungie's release cycles are slow, It takes a couple of months between each release, Some features / routes may not be available on stable version, though, it is still possible to define your own routes on top of aiobungie's clients foundation.

Owner

  • Login: nxtlo
  • Kind: user
  • Location: nil

Python & Rust backend.

GitHub Events

Total
  • Issues event: 1
  • Watch event: 5
  • Delete event: 87
  • Issue comment event: 78
  • Push event: 77
  • Pull request review event: 2
  • Pull request event: 177
  • Create event: 82
Last Year
  • Issues event: 1
  • Watch event: 5
  • Delete event: 87
  • Issue comment event: 78
  • Push event: 77
  • Pull request review event: 2
  • Pull request event: 177
  • Create event: 82

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 669
  • Total Committers: 9
  • Avg Commits per committer: 74.333
  • Development Distribution Score (DDS): 0.468
Past Year
  • Commits: 87
  • Committers: 2
  • Avg Commits per committer: 43.5
  • Development Distribution Score (DDS): 0.195
Top Committers
Name Email Commits
fate d****9@h****m 356
dependabot[bot] 4****] 279
nxtlo f****e@a****n 21
fate a****k@h****m 7
Greg Shiner g****1@i****m 2
coxir 8****r 1
Victor Cyprien 4****n 1
Matthew Coleman m****n@g****m 1
Felix-Maximus 1****s 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 16
  • Total pull requests: 575
  • Average time to close issues: 4 months
  • Average time to close pull requests: 7 days
  • Total issue authors: 4
  • Total pull request authors: 6
  • Average comments per issue: 0.75
  • Average comments per pull request: 0.46
  • Merged pull requests: 340
  • Bot issues: 2
  • Bot pull requests: 547
Past Year
  • Issues: 2
  • Pull requests: 210
  • Average time to close issues: 7 days
  • Average time to close pull requests: 10 days
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.69
  • Merged pull requests: 78
  • Bot issues: 2
  • Bot pull requests: 209
Top Authors
Issue Authors
  • nxtlo (12)
  • dependabot[bot] (2)
  • spacez320 (1)
  • NoahDReifsnyder (1)
Pull Request Authors
  • dependabot[bot] (547)
  • nxtlo (23)
  • xhl6666 (2)
  • VictorCyprien (1)
  • Felix-Maximus (1)
  • spacez320 (1)
Top Labels
Issue Labels
enhancement (5) Feature (4) bug (3) dependencies (2) python (2) optimization (1) redesign (1)
Pull Request Labels
dependencies (547) python (527) github_actions (20) enhancement (19) bug (5) breaking (3) Feature (2) optimization (2) tests (1) redesign (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 340 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 34
  • Total maintainers: 1
pypi.org: aiobungie

A Python and Asyncio API wrapper for Bungie's API.

  • Versions: 34
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 340 Last month
Rankings
Dependent packages count: 7.4%
Stargazers count: 10.1%
Forks count: 11.0%
Downloads: 17.6%
Average: 23.0%
Dependent repos count: 69.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

dev-requirements.txt pypi
  • black * development
  • flake8 * development
  • isort * development
  • mock * development
  • mypy * development
  • nox * development
  • pdoc * development
  • pytest * development
  • pytest-asyncio * development
  • python-dotenv * development
poetry.lock pypi
  • aiohttp 3.8.1
  • aiosignal 1.2.0
  • async-timeout 4.0.2
  • attrs 22.1.0
  • charset-normalizer 2.0.12
  • frozenlist 1.3.0
  • idna 3.3
  • multidict 6.0.2
  • python-dateutil 2.8.2
  • six 1.16.0
  • yarl 1.7.2
pyproject.toml pypi
  • aiohttp 3.8.1
  • attrs 22.1.0
  • python ^3.9
  • python-dateutil 2.8.2
requirements.txt pypi
  • aiohttp *
  • attrs *
  • python-dateutil *
.github/workflows/ci.yml actions
  • abatilo/actions-poetry 2 composite
  • actions/checkout v3 composite
  • actions/setup-python v4.5.0 composite
  • actions/upload-artifact v3 composite