EVE-SRP relies on outside sources for its killmail information. Whether that source is CREST, zKillboard, or some private killboard does not matter, there just has to be some sort of access to the information somehow. Included with EVE-SRP is support for CREST verified killmails and zKillboard based killboards.
The interface for Killmail is fairly simple. It provides a number of attributes, and for those that correspond to in-game entities, it also provides their ID number. The default implementation has all values set to None. Two implementations for creating a Killmail from a URL are provided: CRESTMail is created from a CREST external killmail link, and ZKillmail is created from a zKillboard details link.
The intent of having killmails handled in a separate class was for administrators to be able to have customized behavior. As an example, here’s a Killmail subclass that will link the ship name to the Eve-Online wiki page for that ship, and only accept killmails from the TEST Alliance killboard.
from evesrp.killmail import ZKillmail, ShipURLMixin
eve_wiki_url = 'https://wiki.eveonline.com/en/wiki/{name}'
EveWikiMixin = ShipURLMixin(eve_wiki_url)
class TestZKillmail(ZKillmail, EveWikiMixin):
def __init__(self, *args, **kwargs):
super(TestZKillmail, self).__init__(*args, **kwargs)
if self.domain not in ('zkb.pleaseignore.com', 'kb.pleaseignore.com'):
raise ValueError("This killmail is from the wrong killboard.")
Base killmail representation.
The ID integer of this killmail. Used by most killboards and by CCP to refer to killmails.
The typeID integer of for the ship lost for this killmail.
The human readable name of the ship lost for this killmail.
This is an optional atribute for subclasses to implement. It’s intended to be used for requests to link to a custom, possibly external, ship-specific page.
The ID number of the pilot who lost the ship. Referred to by CCP as characterID.
The name of the pilot who lost the ship.
The ID number of the alliance corp belonged to at the time of this kill, or None if the corporation wasn’t in an alliance at the time.
The name of the alliance referred to by alliance_id.
A URL for viewing this killmail’s information later. Typically an online killboard such as zKillboard <https://zkillboard.com>, but other kinds of links may be used.
The extimated ISK loss for the ship destroyed in this killmail. This is an optional attribute, and is None if unsupported. If this attribute is set, it should be a Decimal or a type that can be used as the value for the Decimal constructor.
The date and time that this kill occured as a datetime.datetime object (with a UTC timezone).
Whether or not this killmail has been API verified (or more accurately, if it is to be trusted when making a Request.
The system/constellation/region where the kill occured.
Initialize a Killmail with None for all attributes.
All subclasses of this class, (and all mixins designed to be used with it) must call super().__init__(**kwargs) to ensure all initialization is done.
Param: | keyword arguments corresponding to attributes. |
---|
Iterate over the attributes of this killmail.
Yields tuples in the form ('<name>', <value>). This is used by evesrp.models.Request.__init__() to initialize its data quickly. The <name> in the returned tuples is the name of the attribute on the Request.
A user-facing description of what killmails this Killmail validates/handles.
Bases: evesrp.killmail.Killmail, evesrp.killmail.RequestsSessionMixin, evesrp.killmail.ShipNameMixin, evesrp.killmail.LocationMixin
A killmail sourced from a zKillboard based killboard.
The domain name of this killboard.
Create a killmail from the given URL.
Parameters: | url (str) – The URL of the killmail. |
---|---|
Raises: |
|
Bases: evesrp.killmail.Killmail, evesrp.killmail.RequestsSessionMixin, evesrp.killmail.LocationMixin
A killmail with data sourced from a CREST killmail link.
Create a killmail from a CREST killmail link.
Parameters: | url (str) – the CREST killmail URL. |
---|---|
Raises: |
|
Mixin for providing a requests.Session.
The shared session allows HTTP user agents to be set properly, and for possible connection pooling.
Killmail mixin providing Killmail.ship from Killmail.ship_id.
Looks up the ship name using Killmail.ship_id.
Killmail mixin for providing solar system, constellation and region names from Killmail.system_id.
Provides the constellation name using Killmail.system_id.
Provides the region name using Killmail.system_id.
Provides the solar system name using Killmail.system_id.