Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elytra_ms-0.7.3.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

elytra_ms-0.7.3-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

Details for the file elytra_ms-0.7.3.tar.gz.

File metadata

  • Download URL: elytra_ms-0.7.3.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.2

File hashes

Hashes for elytra_ms-0.7.3.tar.gz
Algorithm Hash digest
SHA256 9e07e07433ea89a476cd7f15727d2283c7eb3baa0565ec6f815d6c12ae36090d
MD5 69cbf65de74ed18551ccd52fd8d11b7c
BLAKE2b-256 0b70d392791f41fdc7d8b694a41c902aecd9f3453a72050e8e7479e6495c6c13

See more details on using hashes here.

File details

Details for the file elytra_ms-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: elytra_ms-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 40.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.2

File hashes

Hashes for elytra_ms-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c7dc38d1c6eef6c7cef5a61e0a067f302535c63f8a76880f121e2c54ac330b2d
MD5 13097b92f4ffb226694b51bd0970f728
BLAKE2b-256 fd4976959b394eaa7998126e132f13ecf210a922cb1c130dc5fafbef88691875

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page