Git Product home page Git Product logo

nevekit's Introduction

New Eve Kit

tests codecov Codacy Badge Quality Gate Status

Description

A new Eve Kit Python 3 library to work with CCP's ESI Swagger API, SDE, Image Server and Fuzzworks data.

Project Status

The project is at it's inception phase. Great moment to throw in your 2cs.

Also, for the most part, do something like this in your head.

sed -i 's/offers/will offer/g' README.md
sed -i 's/can/would be/g' README.md

Contributing

A great start is dropping a "hi!" in this new Discussions thing.

Features

  • The kit offers a simple interface to access the CCP's image server.
  • The kit offers a simple interface to access the Eve Online's ESI.
  • The kit offers a simple interface to access the Eve Online's dedicated service Fuzzworks' most useful data.
  • Uses the Bravado library to handle the ESI.
  • ESI Market data is fetched synchronously or in asynchronous batches.
  • The kit encapsulates the SDE data and provides a simple interface to access it.

Installation

The kit can be installed from Pypi using pip:

pip install nevekit

Usage

Image Server

from nevekit.image import ImageServer

# Create an image server instance.
# By default it uses the following image server base URL: https://images.evetech.net/.
image_server = ImageServer()

# Save character id's 2114008190 portrait at size 256 to a file.
#     - The image server returns a PNG image.
#     - It can provide everything described in https://developers.eveonline.com/blog/article/from-image-server-to-a-whole-new-image-service-1:
#         - Character portraits.
#         - Corporation logos.
#         - Alliance logos.
#         - Type icons.
#         - Type renders.
with open('portrait.png', 'wb') as f:
    f.write(image_server.get_character_portrait(2114008190, 256))

SSO

from nevekit.esi.sso import SSO

# Create an SSO instance.
# By default it uses the following SSO base URL: https://login.eveonline.com/.
# It executes the flow described in the example at https://github.com/esi/esi-docs/blob/master/examples/python/sso/esi_oauth_native.py to get an access token.
# TODO: Review the scopes.
# It uses the following scopes: esi-contracts.read_corporation_contracts.v1, esi-contracts.read_character_contracts.v1.
sso = SSO()

# Authenticate a character and get an access token.
# You'll be redirected to the Eve Online's SSO login page.
# After logging in, you'll be redirected to the callback URL.
# The callback URL must be registered in the Eve Online's SSO application.
# You don't need to keep the token returned, it's stored in the SSO instance.
access_token = sso.login('client_id', 'secret_key', 'callback_url')

# Get the authenticated character's id.
character_id = sso.get_character_id()

ESI

Public ESI

from nevekit.esi import ESI
from nevekit.sso import SSO

# Create an ESI instance w/o authentication.
# By default it uses the following ESI base URL: https://esi.evetech.net/.
esi = ESI()

Authenticated ESI

from nevekit.esi import ESI
from nevekit.esi.sso import SSO

# Create an ESI instance with authentication.
# By default it uses the following ESI base URL: https://esi.evetech.net/.
# It uses the access token stored in the SSO instance.
sso = SSO()
sso.login('client_id', 'secret_key', 'callback_url')
esi = ESI(sso=sso)

# Get the authenticated character's standings.
# It uses the following ESI endpoint: /characters/{character_id}/standings/.
standings = esi.get_character_standings()

SDE

from nevekit.sde import SDE

# Create an SDE instance.
# By default it creates a SQLite database at ~/.nevekit/nevekit.db.
sde = SDE()

# Get the type with id 587.
type_obj = sde.get_type(587)

Fuzzworks

from nevekit.fuzzworks import Fuzzworks

# Create a Fuzzworks instance.
# By default it uses the following Fuzzworks base URL: https://www.fuzzwork.co.uk/.
fuzzworks = Fuzzworks()

# Get the SQLite db dump of the Eve Online's SDE.
# This uses the following Fuzzworks endpoint: /dump/sqlite-latest.sqlite.bz2.
fuzzworks.get_sde_dump(db_type='sqlite')

nevekit's People

Contributors

jorgejch avatar dependabot[bot] avatar

Watchers

 avatar

nevekit's Issues

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.