Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

ESY is an ESI wrapper aiming to be simple and pythonic.

Project description

# Introduction

[![Build Status](](
[![Coverage Status](](
[![Documentation Status](](

There are many options for consuming the ESI web services. ESY aims to be an easy-to-use library with the nuts and
bolts of dealing with an OpenAPI interface abstracted away. ESY was created to have an interface reminscient of Entity's
gloriously pythonic [eveapi]( library and to

## Installation

The latest stable version of ESY is available from PyPI:
$ pip install esy

## Documentation

Documentation is available at [](

For documentation of the various ESI routes, ESY also provides a
[terse list]( of their parameters and return types. Further
information can be explored at the main [ESI documentation site](

## Usage

To use ESI, first initialize a client:

from esy.client import ESIClient
client = ESIClient.get_client('my-user-agent')

The client can take a second or two to initialize, as the swagger specification is downloaded and parsed. To speed this
up, you can download the specification locally:

$ curl -o swagger.json

Then initialize the client using the local file:

import json
from esy.client import ESIClient

with open('swagger.json', 'r') as spec_file:
spec = json.load(spec_file)
client = ESIClient.get_client('my-user-agent', spec=spec)

For production instances, keeping the spec in [Redis]( or some other cache is highly recommended.

Once your client is initialized, you can fetch data:

from esy.client import ESIClient
client = ESIClient.get_client('my-user-agent')

# Get list of alliances
alliances = client.Alliance.get_alliances()

# Get info on a corporation
evolution = client.Corporation.get_corporations_corporation_id(corporation_id=144749962)

{'alliance_id': 1727758877,
'ceo_id': 144509256,
'creator_id': 144509256,
'date_founded': datetime.datetime(2003, 7, 30, 8, 33, tzinfo=tzutc()),
'description': 'Those who cannot adapt become victims of Evolution.',
'home_station_id': 60013843,
'member_count': 316,
'name': 'Evolution',
'shares': 1000,
'tax_rate': 0.5,
'ticker': 'EVOL',
'url': '',
'faction_id': None}

# Get paginated asset list
swag = client.Corporation.get_corporations_corporation_id_assets(corporation_id=144749962,
_token='esi token')
# Loop through the asset pages
for page in swag:
for asset in page:
# 22457
# 16074150552

## Development

ESY uses the [Bravado]( OpenAPI library to parse the ESI swagger schema and create
an usable interface. The purpose of creating a custom wrapper of Bravado for ESI, is to make the interface a bit more
user friendly. Pagination is handled automatically by returning generators for any route which accepts a page
parameter, while non-paginated data is handled in their native data type. Tokens can be set per-call, instead of
per-client, allowing for using headers and still getting data for many tokens without the ned to reinitialize the client.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for esy, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size esy-1.0.0-py2.py3-none-any.whl (10.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size esy-1.0.0.tar.gz (10.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page