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.6.tar.gz (25.5 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.6-py3-none-any.whl (48.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: battlenet_client-5.0.6.tar.gz
  • Upload date:
  • Size: 25.5 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.6.tar.gz
Algorithm Hash digest
SHA256 b6224fad8409b7f088d3c4551e51f6d4b1c81a693e9388f1f780d390412b5218
MD5 b7e5249d2cb71d30e95dd4afdc57a2c5
BLAKE2b-256 30906d97220cf3792f4d3f5dba7faec539c237588451586ea4d27c60917e9b86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for battlenet_client-5.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 00261ac6c76527fd23e61f1f7f7cf14075b9eb6494b489ca7c725d25f568cb87
MD5 0d59c1630f3947dcde939abf6548ce02
BLAKE2b-256 4a0708aee1bbf280ad57a88ae2a94cec20e5cacd93d1b3bd7bd0ac27ee985908

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