A Python Library for various Microsoft APIs, including the Xbox and Bedrock Realms APIs.
Project description
elytra-ms
A Python Library for various Microsoft APIs, including the Xbox and Bedrock Realms APIs.
Note: this library is a work in progress! This currently only supports the workflow the Realms Playerlist Bot does, but it is planned to be expanded in the future.
Usage
import anyio # or asyncio, or trio
import elytra
async def main():
xbox_api = await elytra.XboxAPI.from_file(
"CLIENT_ID", "CLIENT_SECRET", oauth_path="oauth.json"
)
print(await xbox_api.fetch_profile_by_gamertag("SomeGamertag"))
await xbox_api.close()
anyio.run(main)
Setup
TODO: actually do this section.
Install Package
Requires Python 3.10+.
pip install -U elytra-ms
Make An Application
Taken from xbox-webapi-python for now, copyright 2020 OpenXbox under MIT.
Authentication is supported via OAuth2.
- Register a new application in Azure AD.
- Name your app.
- Select "Personal Microsoft accounts only" under supported account types.
- Add http://localhost/auth/callback as a Redirect URI of type "Web."
- Copy your Application (client) ID for later use.
- On the App Page, navigate to "Certificates & secrets."
- Generate a new client secret and save for later use.
Get OAuth/Token Data
In your terminal, run:
elytra-authenticate --client-id CLIENT_ID_FROM_ABOVE --client-secret CLIENT_SECRET_FROM_ABOVE
This will create a file called oauth.json
in the directory this is run in. This file alone works with all APIs currently supported.
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
Built Distribution
Hashes for elytra_ms-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a36f5c09c4b0051f138e658dcfdac6155d089b1954ba7852400604837c26d527 |
|
MD5 | 72b2304b7b1c8c1d9bbcb4a9fecefe26 |
|
BLAKE2b-256 | fb170a620a9f54f0842759f22bb9df31ad0cf5f7337308d9e01603b69aefa8e7 |