Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install battlenet

How to install battlenet

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install battlenet
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2.6 Available View build log
0.2.5 Available View build log
0.2.1 Available View build log
0.1.1 Available View build log
Windows (64-bit)
0.2.6 Available View build log
0.2.5 Available View build log
0.2.1 Available View build log
0.1.1 Available View build log
Mac OS X (10.5+)
0.2.6 Available View build log
0.2.5 Available View build log
0.2.1 Available View build log
0.1.1 Available View build log
Linux (32-bit)
0.2.6 Available View build log
0.2.5 Available View build log
0.2.1 Available View build log
0.1.1 Available View build log
Linux (64-bit)
0.2.6 Available View build log
0.2.5 Available View build log
0.2.1 Available View build log
0.1.1 Available View build log
 
License
MIT
Imports
Lastest release
version 0.2.6 on Jul 5th, 2011

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(public_key='your public key', private_key='your private key')

You can also create connections explicitly.

from battlenet import Connection

connection = Connection(public_key='your public key', private_key='your private 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
character = Character(battlenet.UNITED_STATES, 'Nazjatar', 'Vishnevskiy', fields=[Character.GUILD])

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

print character.name
# => Vishnevskiy

print character.guild.name
# => Excellence

Fetching a guild

from battlenet import Character

# If a global connection was setup
guild = Guild(battlenet.UNITED_STATES, 'Nazjatar', 'Excellence')

# Using a specific connection
guild = connection.get_guild(battlenet.UNITED_STATES, 'Nazjatar', 'Excellence')

print guild.name
# => Vishnevskiy

leader = guild.get_leader()
print leader.name
# => Clí

More Examples

Read the unit tests inside the tests directory.

Subscribe to package updates

Last updated Jul 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.