# Introduction
**************
[](https://travis-ci.org/kriberg/esy)
[](https://coveralls.io/github/kriberg/esy?branch=master)
[](https://esy.readthedocs.io/en/latest/?badge=latest)
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](https://github.com/ntt/eveapi/) library and to
## Installation
The latest stable version of ESY is available from PyPI:
```bash
$ pip install esy
```
## Documentation
Documentation is available at [esy.readthedocs.io](https://esy.readthedocs.io/en/latest/).
For documentation of the various ESI routes, ESY also provides a
[terse list](https://esy.readthedocs.io/en/latest/source/esi.html) of their parameters and return types. Further
information can be explored at the main [ESI documentation site](https://esi.evetech.net/ui)
## Usage
To use ESI, first initialize a client:
```python
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:
```bash
$ curl https://esi.evetech.net/latest/swagger.json -o swagger.json
```
Then initialize the client using the local file:
```python
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](https://redis.io) or some other cache is highly recommended.
Once your client is initialized, you can fetch data:
```python
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)
print(evolution)
{'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': 'http://www.eve-evol.com',
'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:
print(asset.get('type_id'),
asset.get('location_id'))
# 22457
# 16074150552
```
## Development
ESY uses the [Bravado](https://github.com/Yelp/bravado-core) 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.
Metadata
Release files for esy 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| esy-1.0.0.tar.gz | 10.4 kB | Without provenance | Details for esy-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| esy-1.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for esy-1.0.0-py2.py3-none-any.whl |
Total release size: 20.6 kB
Release files / esy-1.0.0.tar.gz
| Download URL | esy-1.0.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
872adf4d926a9bb0e25629a94bc4c9dbbf27350194b6526557093da939fa83e7
|
|
BLAKE2b-256 checksum How to use checksums |
3b0e71de6ebdcfc92c147baf6750ca9ab35e1694c0d9730687892cdc910ab3d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / esy-1.0.0-py2.py3-none-any.whl
| Download URL | esy-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
9407d19f42fe5eaa0ff5fa8a63ae611218e80fc853478fce97dd2f773275163c
|
|
BLAKE2b-256 checksum How to use checksums |
ddc882e41d56c8e932d1086580ae8f32f950a97391ade69c3107f8a2a205dc62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for esy 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.