https://github.com/nxtlo/aiobungie
Python and asyncio Bungie API wrapper.
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
Keywords from Contributors
Repository
Python and asyncio Bungie API wrapper.
Basic Info
- Host: GitHub
- Owner: nxtlo
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://nxtlo.github.io/aiobungie/
- Size: 24.6 MB
Statistics
- Stars: 55
- Watchers: 1
- Forks: 9
- Open Issues: 1
- Releases: 31
Topics
Metadata Files
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
Clientwhen:- 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
RESTClientwhen:- You want an interface similar to
Clientbut 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.
- You want an interface similar to
- Use
RESTPoolwhen:- everything
RESTClientprovides. - You want to spawn multiple
RESTClients. - You're building a distributed backend.
- everything
Dependencies
- aiohttp
- attrs
sain, this is a dependency free utility package.backports.datetime_fromisoformat, required forPython 3.10only.
Features
aiobungie features are extra dependencies that replaces the standard library with either faster/neater pkgs.
speedupThis will include and use orjson as the defaultjsonparser. 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
-Oflagpython 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 resourcesabove. aiobungiedoesn't supportXupdate, what now?aiobungie's REST client has a method calledstatic_requestwhich allows you to make your own requests, check outexamples/custom_clientexample.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 ofaiobungie's clients foundation.
Owner
- Login: nxtlo
- Kind: user
- Location: nil
- Repositories: 3
- Profile: https://github.com/nxtlo
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
Top Committers
| Name | 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
Pull Request Labels
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.
- Homepage: https://github.com/nxtlo/aiobungie
- Documentation: https://aiobungie.readthedocs.io/
- License: MIT
-
Latest release: 0.4.0
published about 1 year ago
Rankings
Maintainers (1)
Dependencies
- black * development
- flake8 * development
- isort * development
- mock * development
- mypy * development
- nox * development
- pdoc * development
- pytest * development
- pytest-asyncio * development
- python-dotenv * development
- 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
- aiohttp 3.8.1
- attrs 22.1.0
- python ^3.9
- python-dateutil 2.8.2
- aiohttp *
- attrs *
- python-dateutil *
- abatilo/actions-poetry 2 composite
- actions/checkout v3 composite
- actions/setup-python v4.5.0 composite
- actions/upload-artifact v3 composite