Skip to main content

Base package for Blizzard's Battle.net 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 speciif 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.2a3.tar.gz (26.7 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.2a3-py3-none-any.whl (45.3 kB view details)

Uploaded Python 3

File details

Details for the file battlenet_client-5.0.2a3.tar.gz.

File metadata

  • Download URL: battlenet_client-5.0.2a3.tar.gz
  • Upload date:
  • Size: 26.7 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.2a3.tar.gz
Algorithm Hash digest
SHA256 40b78086e842c0a392d53b1f915abce4332809d38efad49cb0aa7c57a67908d9
MD5 08192cf2174aec5ff8332bcf2be0e701
BLAKE2b-256 2d5d1ceb1f46437d40058e78eec8d61b7459137ea367817b15a2da0ad831b22e

See more details on using hashes here.

File details

Details for the file battlenet_client-5.0.2a3-py3-none-any.whl.

File metadata

File hashes

Hashes for battlenet_client-5.0.2a3-py3-none-any.whl
Algorithm Hash digest
SHA256 269c59048242b27d30d8813abcb0051d2ac9d68e7775863d37a7e1decf453232
MD5 dbc5b9523cfa0c1e96f9ed5250dc5669
BLAKE2b-256 9fe915fafcdc63934654d61fadb04ff2f0f00b93f8215fe01f2d176c0a4d70e9

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