modules

class esy.client.ESICallableOperation(operation)[source]

Wraps bravado’s CallableOpeartion to handle pagination

class esy.client.ESIClient(swagger_spec, esi_endpoint, user_agent, use_models, cache)[source]

Swagger client interface adapted to use with the ESI.

static get_client(user_agent='esy//vittoros@slack', use_models=False, spec=None, endpoint='https://esi.evetech.net/latest/swagger.json', datasource='tranquility', cache=None)[source]

Generates a client interface for ESI.

Parameters:
  • user_agent (str) –
  • use_models
  • spec
  • endpoint (str) –
  • datasource (str) –
  • cache – A class which implements the cache interface
Returns:

An initalized client

Return type:

ESIClient

static get_swagger_spec(endpoint='https://esi.evetech.net/latest/swagger.json', datasource='tranquility', cache=None)[source]

Downloads and parses the swagger specification from the ESI endpoint.

Parameters:
  • endpoint (str) – URL to the ESI endpoint. Defaults to latest.
  • datasource (str) – ESI datasource to use. Defaults to Tranquility.
  • cache – Optional cache
Returns:

Swagger specification

Return type:

dict

class esy.client.ESIPageGenerator(requests_future, requestsresponse_adapter, operation, response_callbacks, request_config, cache=None)[source]

Generator for ESI API calls.

class esy.client.ESIRequestsClient(user_agent, cache=None)[source]

Extends the bravado RequestsClient to handle pagination, user agent and per-request authorizations.

request(request_params, operation=None, response_callbacks=None, request_config=None, authorization_token=None)[source]
Parameters:
  • request_params (dict) – complete request data.
  • operation (bravado_core.operation.Operation) – operation that this http request is for. Defaults to None - in which case, we’re obviously just retrieving a Swagger Spec.
  • request_config (RequestConfig) – per-request configuration
Returns:

HTTP Future object

Return type:

class:bravado_core.http_future.HttpFuture

class esy.client.ESIResourceDecorator(resource, also_return_response=False)[source]

Extends ResourceDecorator to wrap operations with ESICallableOperation

exception esy.exceptions.ESIAuthorizationError[source]
exception esy.exceptions.ESIError[source]
exception esy.exceptions.ESIForbidden[source]
exception esy.exceptions.ESINotFound[source]
class esy.auth.ESIAuthenticator(access_token_endpoint='https://login.eveonline.com/oauth/token', token_verify_endpoint='https://login.eveonline.com/oauth/verify', revoke_token_endpoint='https://login.eveonline.com/oauth/revoke')[source]

Handles ESI token authentication and verification process.

get_access_token(refresh_token, client_id, secret, session=None, auth=None)[source]

Get a new access token using a refresh token

Parameters:
  • refresh_token (str) – The refresh token
  • client_id (str) – The ESI ClientID
  • secret (str) – The ESI Secret key
  • session (OAuth2Session) – Existing session for reuse
  • auth (HTTPBasicAuth) – Existing authentication handler for reuse
Returns:

New access token

Return type:

str

revoke_token(token, client_id, secret, token_type='refresh_token', session=None, auth=None)[source]

Revoke refresh or access tokens.

Parameters:
  • token (str) – The token to revoke
  • client_id (str) – The ESI ClientID
  • secret (str) – The ESI Secret key
  • token_type (str) – Token type to request from ESI
  • session (OAuth2Session) – Existing session for reuse
  • auth (HTTPBasicAuth) – Existing authentication handler for reuse
Returns:

Token revocation status

Return type:

bool

verify_access_token(access_token)[source]

Verifies the refresh token with the ESI and retrieves character information.

Parameters:access_token (str) – ESI access token
Returns:dict with CharacterID, CharacterName and CharacterOwnerHash
Return type:dict
verify_authorization_code(authorization_code, client_id, secret)[source]

Trades an authorization code for a refresh and an access tokens from ESI

Parameters:
  • authorization_code (str) – The authorization code returned from ESI
  • client_id (str) – The ESI ClientID
  • secret (str) – The ESI Secret key
Returns:

(refresh_token, access_token)

Return type:

tuple