Skip to main content

Package provides easy access to Blizzard Game APIs

Project description

Battlenet Client

Pipeline Status Release coverage

Introduction

While this package can be used as a standalone, it works better when coupled with one of the API packages:

Installation

Base Install

pip install battlenet-client

Optional Installs

  • Developement Install: pip install battlenet-client[dev]
  • Full Client Install: pip install battlenet-client[client]
  • MongoDB Backend: pip install battlenet-client[mongo]
  • PostgreSQL Backend: pip install battlenet-client[postgresql]
  • MySQL or MariaDB Backend: pip install battlenet-client[mysql]

Usage:

To use the client crediential workflow

from battlenet_client.client import BattlenetClient
client = BattlenetClient.client_credentials(<region abbreviation>, <client id>, <client secret>)

To use the authorization workflow and Open ID Connect, you will need a webserver that will handle the callback

from battlenet_client.client import BattlenetClient
client = BattlenetClient.authorization_code(<region abbreviation>, <client id>, <client secret>, <redirect uri>
                                            <scope>)
redirect(client.get_authorization_url()

User logs into Battl.net with user name and password. After successful login, the user is redirected to "<redirect_uri>" As part of the example code uses a Flask app to perform the role of the web server.

@app.route(<redirect uri>)
def callback():
    client.callback(request.args.get("code"), request.args.get("state"))
    ...

The webserver then processes and save the new token for the user

See the instructions for the specific module for further details.

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

battlenet_client-5.0.7.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

battlenet_client-5.0.7-py3-none-any.whl (49.9 kB view details)

Uploaded Python 3

File details

Details for the file battlenet_client-5.0.7.tar.gz.

File metadata

  • Download URL: battlenet_client-5.0.7.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for battlenet_client-5.0.7.tar.gz
Algorithm Hash digest
SHA256 3eca8113e6effc155f928e22f5ae8fde32cd262f36f0b5771b5f78c53889e022
MD5 e99e19ad777a1c5e3a1fca0757c1cd57
BLAKE2b-256 916ea0abd2f922ae446d1adb69f3a3c713e9019da559ef35077f581be1f1388b

See more details on using hashes here.

File details

Details for the file battlenet_client-5.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for battlenet_client-5.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bcf19b3112e5993efa84970b68135b85c2ce8ad6a733a975d71ab5c3d0aea6c6
MD5 837fecf75476c37dc7aa1338b840dceb
BLAKE2b-256 87aebf41ef0894619bc8e6942f912adf7ff539ed017c7acd6b0aaba3a5294f01

See more details on using hashes here.

Supported by

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