You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Flying Kiwi 5a5b7957f8 Fix setup 3 years ago
esipysi Big cache update 3 years ago
tests Big cache update 3 years ago
.gitignore Fix issue with path 6 years ago
LICENSE Add esi session 3 years ago Init 6 years ago Big cache update 3 years ago
license.txt Added setup info 6 years ago Big cache update 3 years ago
requirements.txt Big cache update 3 years ago Big cache update 3 years ago Fix setup 3 years ago
test_requirements.txt Housekeeping and bugfixes 3 years ago


EsiPysi (pronounced like "Easy Peasy") is a utility for accessing the Eve api called Esi. The goal of this project is to create a lightweight and fast tool which makes devloping with Esi easier.


  • Auth storage and auto refreshing
    • If your access token expires, EsiPysi will acquire a new one
  • Fast API calling and JSON parsing using aiohttp
    • Uses asyncio and event loops so that the API calls are non-blocking
  • Light input validation
    • Only validates that the parameters are in the Esi Swagger Spec, does not validate types/values
  • Caching using Redis
  • Automatic retries for certain error codes
    • Typically those pesky 501s


Install with pip:

pip install EsiPysi

Requires python 3.5+

How to use

Get familliar with the ESI reference and Eve SSO

start with an EsiPysi object, this will keep track of global settings like which Esi version to use (_latest is reccomended) and start a session

from esipysi import EsiPysi

esi = EsiPysi("", user_agent="Your User Agent Here").session()
await esi.start()

It also support the with syntax which will start and stop the sessions for you:

async with EsiPysi("", user_agent="Your User Agent Here").session() as esi:
    #Do stuff here

Now from that object you can create operations, pass the operation ID to the get_operation function

op = esi.get_operation("get_search")

If it requires authorization you can use EsiAuth

You can either get one from your client info, access token, refresh token, and expire datetime (in UTC)

from esipysi import EsiAuth


Or you can get it from less data such as an authorization code you got back from the callback or just a refresh token:

from esipysi import EsiAuth

auth = await EsiAuth.from_authorization_code(CLIENT_ID, CLIENT_SECRET, AUTHORIZATION_CODE)
auth = await EsiAuth.from_refresh_token(CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN)

And then you can execute that operation with parameters

result = await op.execute(categories="character", search="Flying Kiwi Sertan")

When you are finished with a session, it is reccomended to stop it:

await esi.stop_session()

Response Object

EsiPysi returns a response object called EsiResponse, it contains the following:

  • response.text - The plain text of the body of the response
  • resonse.json() - The text decoded as json into a python Dict
  • response.status - The HTTP status code
  • response.headers - a CIMultiDict which is a special dict cabable of holding multiple of the same key because headers are funky. They act just like a Dict with some extras.


EsiPysi has caching provided by redis. First create a redis client.

Example from redis-py

import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)

Now create a RedisCache object and pass it to the EsiPysi object

from esipysy import EsiPysi
from esipysy.cache import RedisCache
cache = RedisCache(r)
esi = EsiPysi("", user_agent="Your User Agent Here", cache=cache)

Note: By default a DictCache is used, if you want to disable all caching, you can manually set cache=None

In game: Flying Kiwi Sertan