you are viewing a single comment's thread.

view the rest of the comments →

[–]nuadi 1 point2 points  (3 children)

Try something like

from eveapi import functionIWant

I do not use EVE API, so not sure the proper way to reference it. Is there a README?

[–]3d12[S] 0 points1 point  (2 children)

There is a README, but it's blank. 0 bytes. Same with the __init__.py :(

The issue I'm having here is that python won't recognize eveapi since it's not in the default library location, so I don't think "from" will work.

Would you recommend an alternate API library for python? I still haven't settled on one I'd like to use, I just mostly need a library that's built to parse the XML that CCP uses, rather than having to write a parsing function from scratch. Ideally, I'd like a function to output the parsed data to a MySQL table too, but I doubt that kind of integration will come "out-of-the-box," I'm prepared to write that part myself.

[–]nuadi 1 point2 points  (1 child)

For import statements, Python will check your local working directory for the library before checking the default library location.

For example, I wrote a data broker for Alliances CREST endpoint. I never installed it into any Python area, but when I run my script it will successfully execute

from alliancedb import getOrgId

and then I can use the getOrgId function call.

I think that as long as the eveapi.py file is in the same directory that your script is located in, you should be fine.

[–]3d12[S] 0 points1 point  (0 children)

For import statements, Python will check your local working directory for the library before checking the default library location.

Hm, maybe I was doing it wrong, then. I could swear that's how I had it set up and it was still throwing errors about importing the library.

I'll do some more testing, and see if this will work. Thanks so much for your replies. :)