Git Product home page Git Product logo

evecommon's Introduction

EveCommonLibrary

Notes

This was originally posted on github by Depre, however that repo has since been deleted. Since it was released under the MIT License and because EveIntel requires it, I am reuploading it. This is the state of the repo as of aprox 2/5/2015. I do not plan on maintaining it barring a change in the api for https://zkillboard.com

-Marclass

Requirements

  • Python 2.7
  • Python Requests library
  • Eve Online SDE as SQLite Database (you can get it from Fuzzwork)

Usage

There are four easy to use modules available. Please include a user agent when requesting data from any service.

SDEConnector

The SDEConnector is a wrapper to extract data out of the Eve Online SDE. It can easily be expanded to include more complex queries.

from EveCommon.SDEConnector import SDEConnector

sde = SDEConnector(db_name='C:\Database\sqlite-latest.sqlite')
types = sde.get_types_with_market_group()
print('There are %d Items on the market.' % len(types))

ZKillboard

The ZKillboard class extracts Killmails form ZKillboard using the provided API.

from EveCommon.ZKillboard import ZKillboard
from datetime import datetime, timedelta

end_time = datetime.now()
start_time = end_time - timedelta(days=3)

zKill = ZKillboard(user_agent='Your USERAGENT', alliance_id=99003214, losses=True, no_attackers=True,
                   start_time=start_time, end_time=end_time, solar_system_id=30000142)
killmails = zKill.get_killmails()
print('The Brave Collective had %d losses in Jita during the last three days' % len(killmails))

EveCentral

The EveCentral class extracts prices from Eve-Central using the provided API.

from EveCommon.EveCentral import EveCentral

ec = EveCentral(user_agent='Your USERAGENT', type_id=34, system_id=30000142)
price = ec.get_prices_list()
print('The lowest price for Tritanium in Jita is %s ISK.' % price[0].sell.minimum)

Combining all Eve classes

A simple example on how to combine all three Classes can be found in example.py

GuildWars2

The GuildWars2 Class gets Data from the official Guild Wars 2 API.

from EveCommon.GuildWars2 import GuildWars2

items = GuildWars2.get_request_from_url('https://api.guildwars2.com/v1/items.json').json()
items = items['items']

gw2 = GuildWars2(user_agent='Your USERAGENT', id_list=items, api='items')

item_detail_list = gw2.get_api_response_list()

for item_details in item_detail_list:
    print(item_details.id, item_details.name)

evecommon's People

Contributors

marclass avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.