Giter Club home page Giter Club logo

evelink's Introduction

EVELink - Python Bindings for the EVE API

EVELink provides a means to access the EVE API from Python.

Example Usage

import evelink.api # Raw API access
import evelink.eve # Wrapped API access for the /eve/ API path

# Using the raw access level to get the name of a character
api = evelink.api.API()
result = api.get('eve/CharacterName', {'IDs': [1]})
print result.find('rowset').findall('row')[0].attrib['name']

# Using the wrapped access level to get the name of a character
eve = evelink.eve.EVE()
print eve.character_name_from_id(1)

# Using authenticated calls
api = evelink.api.API(api_key=(12345, 'longvcodestring'))
charid = eve.character_id_from_name("Character Name")
char = evelink.char.Char(char_id = charid, api=api)
print char.wallet_balance()

Dependencies

EVELink does not require any extra dependencies for normal operation.

If you are developing on EVELink, however, the following packages are required in order to run the tests:

  • mock
  • nose
  • unittest2

A requirements.txt is provided as part of the repository for developer convenience.

Design

EVELink aims to support 3 "levels" of access to EVE API resources: raw, wrapped, and object.

Raw access

Raw is the lowest level of access - it's basically just a small class that takes an API path and parameters and returns an xml.etree.ElementTree object. You probably don't want to use this layer of access, but it can be useful for API calls that EVELink doesn't yet support at a higher level of access.

Wrapped access

Wrapped is the middle layer of access. The methods in the wrapped access layer still map directly to EVE API endpoints, but are "nicer" to work with. They're actual Python functions, so you can be sure you're passing the right arguments. They return basic Python types which makes the results simple to use.

Object access

(not yet implemented)

Object access is the highest layer of access and the most encapsulated. Though implementation is being deferred until after the wrapped access layer is more complete, the goal here is to essentially emulate a set of ORM objects, allowing you do to things like Character(id=1234).corporation.name to fetch the name of the corporation that the character with ID 1234 is in.

Development

To acquire a development copy of the library and set up the requirements for testing:

$ git clone https://github.com/eve-val/evelink.git
$ cd evelink
$ virtualenv venv --distribute
$ source venv/bin/activate
$ pip install -r requirements.txt

To run the tests:

$ nosetests

To run the tests, including the appengine ones (this requires that you have Google AppEngine's python SDK installed):

$ cd tests
$ nosetests --with-gae

Additional information for developers is available here.

evelink's People

Contributors

ayust avatar zigdon avatar lizthegrey avatar swsnider avatar jerub avatar aliaras avatar mcmillen avatar annabunches avatar cheezy52 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.