Skip to main content

Python Library for Blizzard's Community Platform API

Project description

Python Library for Blizzard’s Community Platform API

Major features

  • Pythonic

  • Unicode normalization

  • Lazyloading and eagerloading

  • Eventlet support

Making a connection

Global connection settings can be setup so that objects can make connections implicitly.

from battlenet import Connection

Connection.setup(app='app key')

You can also create connections explicitly.

from battlenet import Connection

connection = Connection('app key')

Fetching a specific realm

from battlenet import Realm

# If a global connection was setup
realm = Realm(battlenet.UNITED_STATES, 'Nazjatar')

# Using a specific connection
realm = connection.get_realm(battlenet.UNITED_STATES, 'Nazjatar')

print realm.name
# => Nazjatar

print realm.is_online()
# => true

print realm.type
# => PVP

Fetching all realms

for realm in connection.get_all_realms():
    print realm

Fetching a character

from battlenet import Character

# If a global connection was setup
realm = Character(battlenet.UNITED_STATES, 'Nazjatar', 'Vishnevskiy', fields=[Character.GUILD])

# Using a specific connection
realm = connection.get_character(battlenet.UNITED_STATES, 'Nazjatar', 'Vishnevskiy', fields=[Character.GUILD]))

print character.name
# => Vishnevskiy

print character.guild.name
# => Excellence

More Examples

Read the unit tests inside the tests directory.

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

battlenet-0.1.1.tar.gz (9.9 kB view details)

Uploaded Source

File details

Details for the file battlenet-0.1.1.tar.gz.

File metadata

  • Download URL: battlenet-0.1.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for battlenet-0.1.1.tar.gz
Algorithm Hash digest
SHA256 67761efa3301b0364a8fc81ab0e6bcd90472ee48050e373a26c02f6b0fa1e585
MD5 1cef0358d1dbfdcecde639930ce1a6bc
BLAKE2b-256 7b5bffb0e354273db7965b5534a5f1c2df37cab618381de388056f26fc84a8f1

See more details on using hashes here.

Supported by

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