vishnevskiy / battlenet Goto Github PK
View Code? Open in Web Editor NEWPython Library for Blizzard's Community Platform API
Home Page: http://guildwork.com
License: MIT License
Python Library for Blizzard's Community Platform API
Home Page: http://guildwork.com
License: MIT License
Do you have any plans to update the version of this library that's on PyPi? Or was it someone else that posted it there?
"namedtuple" is a Python 2.6 feature not present in 2.5. The Google App Engine environment requires Python 2.5.
File "test/battlenet/things.py", line 529, in init
Tree = collections.namedtuple('Tree', ('points', 'total',))
AttributeError: 'module' object has no attribute 'namedtuple'
If you could use something other than namedtuple that would be great! :)
A test in test_data.py fails with a 500 error.
File "test/test_data.py", line 70, in test_items
item = self.connection.get_item(battlenet.UNITED_STATES, 60249)
File "test/battlenet/connection.py", line 217, in get_item
data = self.make_request(region, '/data/item/%d' % item_id)
File "test/battlenet/connection.py", line 110, in make_request
raise APIError(str(e))
APIError: HTTP Error 500: Internal Server Error
in things.py, line 453
self.average_item_level_equiped = data['averageItemLevelEquipped']
should be
self.average_item_level_equipped = data['averageItemLevelEquipped']
(missing a 'p')
Test failure in test_character.py: Mismatching achievement dates?
File "test_character.py", line 104, in test_achievements
self.assertEqual(character.achievements[513], datetime.datetime(2011, 1, 25, 12, 22, 8))
AssertionError: datetime.datetime(2011, 1, 25, 15, 22, 8) != datetime.datetime(2011, 1, 25, 12, 22, 8)
The version of this project on PyPi is three years old. #23 was opened a year and a half ago to update it, and hasn't even been commented on. There are a bunch of open pull requests with little to no activity.
I need something like this for a project of mine, and more importantly, I need something that works with Python 3.
Is it worth it for me to open a pull request? @vishnevskiy, do you have interest in continuing development on this? If not, would you consider letting someone else take over the project here and on PyPi? If no to both, would you mind if I forked this, renamed it, merged some of these outstanding PRs, and uploaded that to pypi?
Throws error when attempting to decode inputs of non-standard english characters. For instance, test_unicode () in test_character.py results in:
Traceback (most recent call last):
File "C:\Users\Isaac\Desktop\test_character.py", line 87, in test_unicode
character = Character(battlenet.UNITED_STATES, 'Nazjatar', 'ClÃ')
File "D:\Python27\lib\battlenet\things.py", line 135, in init
data = self.connection.get_character(region, realm, name, raw=True, fields=self._fields)
File "D:\Python27\lib\battlenet\connection.py", line 114, in get_character
name = quote(name.lower())
File "D:\Python27\lib\battlenet\utils.py", line 13, in quote
return urllib.quote(normalize(name))
File "D:\Python27\lib\battlenet\utils.py", line 7, in normalize
name = name.decode('utf8')
File "D:\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 2-3: unexpected end of data
I ran this test after the following resulted in a similar error:
import battlenet
from battlenet import Connection, Character
character = Character(battlenet.UNITED_STATES,'Stormreaver','Tøth',fields=[Character.ITEMS])
ø is character 248 in Latin1. Resulting error reads:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in
character = Character(battlenet.UNITED_STATES,'Stormreaver','Tøth',fields=[Character.ITEMS])
File "D:\Python27\lib\battlenet\things.py", line 135, in init
data = self.connection.get_character(region, realm, name, raw=True, fields=self._fields)
File "D:\Python27\lib\battlenet\connection.py", line 114, in get_character
name = quote(name.lower())
File "D:\Python27\lib\battlenet\utils.py", line 13, in quote
return urllib.quote(normalize(name))
File "D:\Python27\lib\battlenet\utils.py", line 7, in normalize
name = name.decode('utf8')
File "D:\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf8 in position 1: invalid start byte
Possible user error? I ran the test to be sure. Running Python 2.7 on Windows.
If a talent tree is blank there is no name or icon
As stated in the title, updating a character by referring to unknown data fails for names which require unicode characters
Code example:
import battlenet
REGION = battlenet.UNITED_STATES
REALM = 'Nazjatar'
GUILD = 'Excellence'
from battlenet import Connection
from battlenet import Guild
from battlenet import Character
Connection.setup()
def test_1():
g = Guild(REGION, REALM, GUILD, fields=[Guild.MEMBERS])
c = g.get_leader()
foo = c.talents # Produces an error
def test_2():
c = Character(REGION, REALM, u'Clí')
foo = c.talents # Another error
def test_3():
c = Character(REGION, REALM, u'Clí', fields=[Character.TALENTS])
foo = c.talents # Works fine
The error returned:
Traceback (most recent call last):
File "<<Work Directory>>\testsuite.py", line 17, in <module>
foo = c.talents
File "<<Work Directory>>\battlenet\things.py", line 254, in talents
if self._refresh_if_not_present(Character.TALENTS):
File "<<Work Directory>>\battlenet\things.py", line 43, in _refresh_if_not_present
self.refresh(field)
File "<<Work Directory>>\battlenet\things.py", line 271, in refresh
self.name, raw=True, fields=self._fields))
File "<<Work Directory>>\battlenet\connection.py", line 114, in get_character
name = quote(name.lower())
File "<<Work Directory>>\battlenet\utils.py", line 13, in quote
return urllib.quote(normalize(name))
File "<<Work Directory>>\battlenet\utils.py", line 7, in normalize
name = name.decode('utf8')
File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 2-3: unexpected end of data
If guildwork are using your lib atm then it doesn't support names in russian, i think it caused by link encoding.
The new Monk class (id 10) is missing in enums.py
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.