open All Channels
seplocked EVE Technology Lab
blankseplocked Advanced Python EVE API wrapper
 
This thread is older than 90 days and has been locked due to inactivity.


 
Pages: 1 [2] 3 4

Author Topic

Entity
X-Factor Industries
Synthetic Existence
Posted - 2008.09.23 10:32:00 - [31]
 

Anti-Thread-AutoLock bump :)

Also note that while this api module does not seem to be updated when CCP adds new api methods, it will happily work with those.

Thor Richt
Posted - 2008.09.23 23:08:00 - [32]
 

Edited by: Thor Richt on 23/09/2008 23:08:33
FYI: I tend to change line 339 (in 1.6) to the following:

raise RuntimeError("Invalid API response: expected 'eveapi', got %s" % name)

During downtimes, and other flakiness on the api server, this reports the error messages coming from their http server. (All I changed was printing the value "if name != 'eveapi'".)

Carlos Adan
Posted - 2008.10.27 22:06:00 - [33]
 

Hi there.
Is there any easy way to get transaction data from a given TransactionID to today?

Sry, but i am really new to the API stuff.

Ambo
I've Got Nothing
Posted - 2008.10.27 23:13:00 - [34]
 

Fraid not, you can only go back a max of 1000 transactions or 1 week if you have more than 1000 transactions in a week.

Carlos Adan
Posted - 2008.10.27 23:58:00 - [35]
 

Hi. Thanks, but thats not the problem. Lets say i used my script to write the sales data 3 days ago, now i want to add the new data, but i want the iteration to start at the point i did the last check, not the beginning of the list.

Entity
X-Factor Industries
Synthetic Existence
Posted - 2008.11.13 16:52:00 - [36]
 

There is currently a problem getting the character sheet. The rowset containing the certificates is missing a required attribute (columns). This is not an eveapi.py bug.

Dragonaire
Caldari
Corax.
PURgE Alliance
Posted - 2008.11.13 21:45:00 - [37]
 

I'd say counting on have a columns field is a bug myself ;)
There has been/are still other APIs that don't have it. Without a formal DTD or something from CCP you can't really call it wrong for it not to be there.

Entity
X-Factor Industries
Synthetic Existence
Posted - 2008.11.14 01:03:00 - [38]
 

Originally by: Dragonaire
I'd say counting on have a columns field is a bug myself ;)
There has been/are still other APIs that don't have it. Without a formal DTD or something from CCP you can't really call it wrong for it not to be there.


Uneducated response is uneducated.

What if you get an empty set but still want the columns to display in a list in an application?

Not to mention I helped Garthagk out back when he was designing this thing, so I think I am more than qualified to call it wrong for it not to be there.

Dragonaire
Caldari
Corax.
PURgE Alliance
Posted - 2008.11.14 03:01:00 - [39]
 

Don't think the flaming was called for and if you were so involved then why didn't you make a DTD or XSD and release it? That would have not only help all the third party developers but also the people that followed you when adding new stuff to API. As far as using the columns stuff to title page columns I don't do that because that would be mixing model and view which is usually considered bad form in MVC and doesn't let you have as much control over what fields you might want to show the users.

Next time you might try explain why you think it's a bug not attack someone for pointing out what sounds like a false assumption or statement to them for you to be making.

Entity
X-Factor Industries
Synthetic Existence
Posted - 2008.11.14 12:38:00 - [40]
 

Originally by: Dragonaire
Don't think the flaming was called for


Heh, you call that flaming already? You're essentially considering my lib bugged and I can't make a counter comment? Lighten up Very Happy

Originally by: Dragonaire
and if you were so involved then why didn't you make a DTD or XSD and release it? That would have not only help all the third party developers but also the people that followed you when adding new stuff to API.


There were limits to my involvement, obviously. It was just discussed in an IRC channel with a few other people. DTD/XSD would have been nice, yes.

Originally by: Dragonaire
As far as using the columns stuff to title page columns I don't do that because that would be mixing model and view which is usually considered bad form in MVC and doesn't let you have as much control over what fields you might want to show the users.


Sure. I just took a random example. There are plenty of reasons for wanting to know the columns before the actual data comes up anyway.

Originally by: Dragonaire
Next time you might try explain why you think it's a bug not attack someone for pointing out what sounds like a false assumption or statement to them for you to be making.


Seriously though. Even ignoring all that, there is still the fact that every single other rowset tag has the columns attribute, so I'd take the bet it's a bug any day.

Dragonaire
Caldari
Corax.
PURgE Alliance
Posted - 2008.11.14 13:19:00 - [41]
 

No problem Entity guess for my part the 'Uneducated response is uneducated.' comment just struck a nerve with me Very Happy

I won't disagree that since it has been the policy in the past for them to include a columns attribute on rowsets then they really should be here as well. I just never have because they do from time to time seem to forget them at least when first releasing new APIs and I didn't want that breaking what I was doing Smile I've made assumptions like that on other things I thought I know before about the API and had it bite me Sad

Entity
X-Factor Industries
Synthetic Existence
Posted - 2008.11.14 15:10:00 - [42]
 

Originally by: Dragonaire
No problem Entity guess for my part the 'Uneducated response is uneducated.' comment just struck a nerve with me Very Happy


Sorry =^.^=

Anyway, there's some merit in working around this issue, and it was a simple workaround, so I've updated the module (see OP).

# Version: 1.0.7 - 14 November 2008
# - Added workaround for rowsets that are missing the (required!) columns
# attribute. If missing, it will use the columns found in the first row.
# Note that this is will still break when expecting columns, if the rowset
# is empty [Flux/Entity]
#

Chop Shop
Posted - 2008.11.21 21:28:00 - [43]
 

Hello Entity,

I'm just fooling around with the python and it seems there is more problems than unhandled exceptions. Shocked
Quote:

# Now use the Get() method to get a row directly.
# Assumes ISD alliance exists. If it doesn't, we probably have bigger
# problems than the unhandled exception here -_-
print alliances_by_ticker.Get("ISD")

# You may specify a default to return in case the row wasn't found:
print alliances_by_ticker.Get("123456", 42)

# If no default was specified and you try to look up a key that does not
# exist, an appropriate exception will be raised:
try:
print alliances_by_ticker.Get("123456")
except KeyError:
print "This concludes example 5"


..and I guess the failsafe? of 123456 is something I would edit to be an existing alliance ticker? like BOB or OHGOD ?

Below is the python shell output I got -- I assume the output may be academic to you but I am working with the API and python for the first time.

Having said that, what is the significance of the ",42" above? Just wondering if I need to fiddle with that if I chance the alliance ticker..

Quote:

Traceback (most recent call last):
File "Q:\eve_api_py_107\apitest.py", line 239, in <module>
print alliances_by_ticker.Get("ISD")
File "Q:\eve_api_py_107\eveapi.py", line 614, in Get
raise KeyError, key
KeyError: 'ISD'
>>>


Entity
X-Factor Industries
Synthetic Existence
Posted - 2008.11.22 12:46:00 - [44]
 

Originally by: Chop Shop

Quote:

# You may specify a default to return in case the row wasn't found:
print alliances_by_ticker.Get("123456", 42)

# If no default was specified and you try to look up a key that does not
# exist, an appropriate exception will be raised:
try:
print alliances_by_ticker.Get("123456")
except KeyError:
print "This concludes example 5"



..and I guess the failsafe? of 123456 is something I would edit to be an existing alliance ticker? like BOB or OHGOD ?

Below is the python shell output I got -- I assume the output may be academic to you but I am working with the API and python for the first time.

Having said that, what is the significance of the ",42" above? Just wondering if I need to fiddle with that if I chance the alliance ticker..




The second argument to Get() is .. well, like the example says already, the default.
It just provides you with an interface almost identical to the get() method on dictionaries. I just used the alliances thing here to demonstrate it, but it might as well have been this:

usernameByID = {1: "john", 2: "mark"}
x = 3
name = usernameByID.get(x, "guest")


versus


usernameByID = {1: "john", 2: "mark"}
x = 3
try:
name = usernameByID[x]
except KeyError:
name = "guest"


Of course if one doesn't handle the exception, like what happens here:

Originally by: Chop Shop

Quote:

Traceback (most recent call last):
File "Q:\eve_api_py_107\apitest.py", line 239, in <module>
print alliances_by_ticker.Get("ISD")
File "Q:\eve_api_py_107\eveapi.py", line 614, in Get
raise KeyError, key
KeyError: 'ISD'
>>>




Then, well... Let's just say the example isn't supposed to do that.

The problem here is that CCP appears to have the habit of letting the ISD alliance expire Rolling Eyes
I used ISD in the example assuming it to be a permanent entry in the database, but it isn't :D

Just change it to something that exists to fix that Wink


Chop Shop
Posted - 2008.11.23 06:28:00 - [45]
 

Thank you for the explanations. Beyond the call of duty, I appreciate it.. and the API wrapper. It'll surly help me after I try my hand at some python CGI and other stuff to get some experience under my belt.

Ah, ISD is a CCP alliance. I was thinking that was one that you had interest in. Glad to hear that it wasn't your alliance that disappeared.

graalman
Posted - 2009.01.06 18:41:00 - [46]
 

Entity, first I would like to thank you for your work, I have been using it for around a year now.

here is two small changes over the latest version (1.0.7)
- python 2.6 exception.message depreciation
- proxy support for eveapi (for people connecting via a proxy)

the changes are done to be minimal impact on the code - i have been using this hack for a year, but thought would be nice to share it
the proxy support is done via a module variable so that the client code needs to set it up
i.e.

client.py:

import eveapi
eveapi.proxy=('my.proxy.net',8000)
(the default is set to None, for backwards compatibility)
then same as before....



Changes: (you can remove the comment lines I added)
2 places.
######################################
A) Lines 70 - 80:


from calendar import timegm

#----------------PROXY-MODIF-START-
proxy=None #default behaviour, change this module variable to (my.proxy.net,8088) for usage via a proxy
#----------------PROXY-MODIF-END---

#-----------------------------------------------------------------------------

class Error(StandardError):
def __init__(self, code, message):
self.code = code
#----------------Exception.message depreciation py2.6-fix-START
self.args = (message.rstrip("."),)
#----------------Exception.message depreciation py2.6-fix-END



####################################
B) Lines 222-239 (previously 217-224):


if response is None:
#----------------PROXY-MODIF-START-
if proxy==None:
http = httplib.HTTPConnection(self._host)
else:
http = httplib.HTTPConnection(proxy[0],proxy[1])
if kw:
if proxy==None:
http.request("POST", path, urllib.urlencode(kw), {"Content-type": "application/x-www-form-urlencoded"})
else:
http.request("POST", 'http://'+self._host+path, urllib.urlencode(kw), {"Content-type": "application/x-www-form-urlencoded"})
else:
if proxy==None:
http.request("GET", path)
else:
http.request("GET", 'http://'+self._host+path)
#----------------PROXY-MODIF-END---
response = http.getresponse()




Entity
X-Factor Industries
Synthetic Existence
Posted - 2009.01.15 23:03:00 - [47]
 

Version 1.1.0 is now available! (see OP for location)

# Version: 1.1.0 - 15 Januari 2009
# - Added Select() method to Rowset class. Using it avoids the creation of
# temporary row instances, speeding up iteration considerably.
# - Added ParseXML() function, which can be passed arbitrary API XML file or
# string objects.
# - Added support for proxy servers. A proxy can be specified globally or
# per api connection instance. [suggestion by graalman]
# - Some minor refactoring.
# - Fixed deprecation warning when using Python 2.6.


the apitest.py test script has also been updated to show the use of Select()

Pasion Helada
SPANI
T o r m e n t u m
Posted - 2009.03.16 13:04:00 - [48]
 

Hi,

Any chance for an update to use the new SkillQueue?

Entity
X-Factor Industries
Synthetic Existence
Posted - 2009.03.21 16:54:00 - [49]
 

Skillqueue works fine as far as I know.
It's just CCP using the incorrect XML formatting for the elements (should use rowsets), so I'm kind of waiting for CCP to correct this (I've made them aware of the problem), as fixing this in the api module would require making it aware of the SkillQueue method, which completely goes against the "anonymous" nature of the design.

As a workaround you can check whether there's just 1 skill element or a rowset. It's only 2-3 lines of code ;-)

Lumy
Minmatar
Sebiestor Tribe
Posted - 2009.03.21 17:13:00 - [50]
 

Originally by: Entity
Skillqueue works fine as far as I know.
It's just CCP using the incorrect XML formatting for the elements (should use rowsets), so I'm kind of waiting for CCP to correct this (I've made them aware of the problem), as fixing this in the api module would require making it aware of the SkillQueue method, which completely goes against the "anonymous" nature of the design.

As a workaround you can check whether there's just 1 skill element or a rowset. It's only 2-3 lines of code ;-)


Last time I checked char/SkillQueue was using "correct" format. It should be working now.

Entity
X-Factor Industries
Synthetic Existence
Posted - 2009.03.23 14:49:00 - [51]
 

They actually fixed it? omg Shocked

Dragonaire
Caldari
Corax.
PURgE Alliance
Posted - 2009.03.23 21:28:00 - [52]
 

Probably was by mistake I'm sure they'll break it again Twisted Evil

Entity
X-Factor Industries
Synthetic Existence
Posted - 2009.05.31 21:14:00 - [53]
 

Well, it's been a few months and it's still working fine!

(anti thread lock bump)


Oh, anyone using Python 3 btw? I might consider making a version for that.

Draeath
The Scope
Posted - 2009.06.21 11:43:00 - [54]
 

Just wanted to swing by and say thanks! This wrapper is just the ticket!

Amerilia
Posted - 2009.07.16 16:33:00 - [55]
 

Originally by: Entity
Well, it's been a few months and it's still working fine!

(anti thread lock bump)


Oh, anyone using Python 3 btw? I might consider making a version for that.


Yes please

Ilyk Halibut
Blackwater USA Inc.
Random-Violence
Posted - 2009.07.19 17:24:00 - [56]
 

Any chance we could get a Google Code project set up for this?

Alyzza
Ono-Sendai Limited
Posted - 2009.07.26 12:26:00 - [57]
 

Is it possible to retrieve the corporation sheet through the api without authenticating? The corp sheet should be available without limited key.

>>> api.corp.CorporationSheet()
Error: Must provide userID parameter for authentication


Entity
X-Factor Industries
Synthetic Existence
Posted - 2009.07.28 00:47:00 - [58]
 

Originally by: Alyzza
Is it possible to retrieve the corporation sheet through the api without authenticating? The corp sheet should be available without limited key.

>>> api.corp.CorporationSheet()
Error: Must provide userID parameter for authentication




Nope. blame CCP :P

Entity
X-Factor Industries
Synthetic Existence
Posted - 2009.07.28 00:48:00 - [59]
 

Originally by: Ilyk Halibut
Any chance we could get a Google Code project set up for this?


Not sure if there's a point for such a tiny snippet of code.

I'll consider it for next version (if/when that comes), though. Maybe add a setup.py etc.

Alyzza
Ono-Sendai Limited
Posted - 2009.07.28 14:31:00 - [60]
 

Originally by: Entity

Nope. blame CCP :P


The logic behind your code is so lisp-esque i was aroused. Obviously, there should be a /eve/CorporationSheet.xml.aspx. Blaming CCP for this ofc. Nothing like hard-coded apikeys to do a simple corporation query ;)


Pages: 1 [2] 3 4

This thread is older than 90 days and has been locked due to inactivity.


 


The new forums are live

Please adjust your bookmarks to https://forums.eveonline.com

These forums are archived and read-only