{"id":18368861,"url":"https://github.com/nxtlo/aiobungie","last_synced_at":"2025-04-05T07:08:18.623Z","repository":{"id":38187980,"uuid":"339008882","full_name":"nxtlo/aiobungie","owner":"nxtlo","description":"Python and asyncio Bungie API wrapper.","archived":false,"fork":false,"pushed_at":"2024-10-29T20:04:45.000Z","size":26939,"stargazers_count":51,"open_issues_count":1,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-29T22:40:20.957Z","etag":null,"topics":["aiobungie","bungie-api","bungie-destiny-api","destiny2","hacktoberfest","python3"],"latest_commit_sha":null,"homepage":"https://nxtlo.github.io/aiobungie/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nxtlo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-15T08:18:51.000Z","updated_at":"2024-10-29T20:04:48.000Z","dependencies_parsed_at":"2024-01-14T11:48:05.143Z","dependency_job_id":"46921252-1169-4224-90b8-0d8c30a1f900","html_url":"https://github.com/nxtlo/aiobungie","commit_stats":{"total_commits":452,"total_committers":6,"mean_commits":75.33333333333333,"dds":0.3075221238938053,"last_synced_commit":"b19a02bb97d6496273c66dd9215b37b7c16d5dbc"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxtlo%2Faiobungie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxtlo%2Faiobungie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxtlo%2Faiobungie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxtlo%2Faiobungie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nxtlo","download_url":"https://codeload.github.com/nxtlo/aiobungie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299833,"owners_count":20916190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiobungie","bungie-api","bungie-destiny-api","destiny2","hacktoberfest","python3"],"created_at":"2024-11-05T23:27:41.970Z","updated_at":"2025-04-05T07:08:18.597Z","avatar_url":"https://github.com/nxtlo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aiobungie\n\nAn ergonomic, statically typed, asynchronous API wrapper that supports Bungie's REST API for Python 3.\n\naiobungie is built to be extensible and reusable, allowing its users to freely switch parts of core implementations with their own incase of future circumstances.\n\n## Installing\n\nCurrently Python 3.10, 3.11, 3.12 and 3.13 are supported.\n\nStable `pip`.\n\n```sh\npip install aiobungie\n```\n\nunstable releases via GitHub master.\n\n```sh\npip install git+https://github.com/nxtlo/aiobungie@master\n```\n\n## Quick Look\n\nSee [Examples](https://github.com/nxtlo/aiobungie/tree/master/examples) for advance usage.\n\n```py\nimport aiobungie\nimport asyncio\n\nclient = aiobungie.Client('YOUR_API_KEY')\n\nasync def main() -\u003e None:\n    # Search for Destiny 2 players.\n    async with client.rest:\n        users = await client.search_users(\"Fate\")\n\n      for user in users:\n        # Print all Destiny 2 memberships for this user.\n        print(user.memberships)\n\n\nasyncio.run(main())\n```\n\n## RESTful clients\n\naiobungie also provides a stand-alone [RESTClient](https://nxtlo.github.io/aiobungie/aiobungie/rest.html#RESTClient) / [RESTPool](https://nxtlo.github.io/aiobungie/aiobungie/rest.html#RESTPool) clients which are the foundation of [Client](https://nxtlo.github.io/aiobungie/aiobungie/client.html#Client), These clients just provide a lower-level abstraction.\n\na `Client` based user may access the `RESTClient` instance bound to it with `.rest` property.\n\n### Example\n\n```py\nimport aiobungie\nimport asyncio\n\n# Single REST client connection.\nclient = aiobungie.RESTClient(\"YOUR_API_KEY\")\n\nasync def main() -\u003e None:\n    async with client:\n        # Download and open the JSON manifest.\n        manifest = await client.download_json_manifest(name=\"latest_manifest\")\n        with manifest.open(\"r\") as file:\n            data = file.read()\n\n        # two simple methods for fetching and refreshing tokens.\n        tokens = await client.fetch_oauth2_tokens('code')\n        refreshed_tokens = await client.refresh_access_token(tokens.refresh_token)\n\n        # making your own requests.\n        response = await client.static_request(\n            \"GET\", # Method.\n            \"Destiny2/path/to/route\", # Route.\n            auth=\"optional_access_token\", # If the method requires OAuth2.\n            json={\"some_key\": \"some_value\"} # If you need to pass JSON data.\n        )\n\nasyncio.run(main())\n```\n\n## When to use which?\n\n* Use `Client` when:\n  * You want a high-level interface.\n  * You're building a Bot, i.e, Discord Bot, Chat Bot.\n  * You're building a CLI tool.\n  * In a single script file.\n* Use `RESTClient` when:\n  * You want an interface similar to `Client` but with extra functionalities.\n  * You want raw JSON responses instead of data-classes.\n  * You want REST API functionalities.\n  * You want full ownership of the requests/responses.\n* Use `RESTPool` when:\n  * everything `RESTClient` provides.\n  * You want to spawn multiple `RESTClient`s.\n  * You're building a distributed backend.\n\n## Dependencies\n\n* aiohttp\n* attrs\n* [`sain`](https://github.com/nxtlo/sain), this is a dependency free utility package.\n* `backports.datetime_fromisoformat`, required for `Python 3.10` only.\n\n### Features\n\naiobungie features are extra dependencies that replaces the standard library with either faster/neater pkgs.\n\n* `speedup`\nThis will include and use [orjson](https://github.com/ijl/orjson)\nas the default `json` parser. It provide faster JSON serialization and de-serialization than the standard Python JSON pkg.\n* `full`: This will include all of the features above.\n\nFor installing the specified feature, type `pip install aiobungie[feature-name]`\n\n## Optimizations\n\n* runtime-assertion: You can disable runtime assertions by passing a `-O` flag `python app.py -O`,\nthe API responses won't get asserted at runtime which may boost the return speeds by a bit.\n* [uvloop](https://github.com/MagicStack/uvloop) (unix systems only): uvloop is an _ultra-fast_ drop in replacement library for the built-in asyncio event loop.\n\n## Contributing\n\nPlease read this [manual](https://github.com/nxtlo/aiobungie/blob/master/CONTRIBUTING.md)\n\n## Related Projects\n\nIf you have used aiobungie and want to show your work, Feel free to Open a PR including it.\n\n* [Fated](https://github.com/nxtlo/Fated/blob/master/core/components/destiny.py): A Discord BOT that uses aiobungie.\n\n## Useful Resources\n\n* Discord Username: `vfate`\n* aiobungie Documentation: [Here](https://nxtlo.github.io/aiobungie/).\n* BungieAPI Discord: [Here](https://discord.gg/vP7VC7TKUG)\n* Official Bungie Documentation: [Here](https://bungie-net.github.io/multi/index.html)\n* Bungie Developer Portal: [Here](https://www.bungie.net/en/Application)\n\n## Notes\n\n* If you need help with something related to this project: Consider opening a blank issue, discussion or checkout the `useful resources` above.\n* `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.\n* `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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxtlo%2Faiobungie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnxtlo%2Faiobungie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxtlo%2Faiobungie/lists"}