Data Structure Reference

Below is a reference to all of the important EVE market data structures. For examples on how to use them, see Quickstart.

MarketOrderList

class emds.data_structures.MarketOrderList(upload_keys=None, order_generator=None, *args, **kwargs)

A list of MarketOrder objects, with some added features for assisting with serializing to the Unified Uploader Data Interchange format.

Attr list_type:This may be used in your logic to separate orders from history.
add_order(order)

Adds a MarketOrder instance to the list of market orders contained within this order list. Does some behind-the-scenes magic to get it all ready for serialization.

Parameters:order (MarketOrder) – The order to add to this order list.
get_all_order_groups()

Uses a generator to return all grouped Item+Region combos, in the form of MarketItemsInRegionList instances. This is useful in that it is possible to express a lack of an item in a specific region.

Note

This is a generator!

Return type:generator
Returns:Generates a list of MarketItemsInRegionList instances, which contain MarketOrder instances.
get_all_orders_ungrouped()

Uses a generator to return all orders within. MarketOrder objects are yielded directly, instead of being grouped in MarketItemsInRegionList instances.

Note

This is a generator!

Return type:generator
Returns:Generates a list of MarketOrder instances.
set_empty_region(region_id, type_id, generated_at, error_if_orders_present=True)

Prepares for the given region+item combo by instantiating a MarketItemsInRegionList instance, which will track region ID, type ID, and generated time. This is mostly used for the JSON deserialization process in case there are no orders for the given region+item combo.

Parameters:
  • region_id (int) – The region ID.
  • type_id (int) – The item’s type ID.
  • generated_at (datetime.datetime) – The time that the order set was generated.
  • error_if_orders_present (bool) – If True, raise an exception if an order already exists for this item+region combo when this is called. This failsafe may be disabled by passing False here.

MarketItemsInRegionList

class emds.data_structures.MarketItemsInRegionList(region_id, type_id, generated_at)

This is an intermediary container that stores MarketOrders for a particular item+region combo. The primary reason it exists is to store generation times for item+region combos that lack orders, since we can’t just yank from the first order’s time in that case.

Attr orders:A list of MarketOrder objects.
add_order(order)

Adds a MarketOrder instance to this region+item list.

Parameters:order (MarketOrder) – The order to add.

MarketOrder

class emds.data_structures.MarketOrder(order_id, is_bid, region_id, solar_system_id, station_id, type_id, price, volume_entered, volume_remaining, minimum_volume, order_issue_date, order_duration, order_range, generated_at)

Represents a market buy or sell order.

MarketHistoryList

class emds.data_structures.MarketHistoryList(upload_keys=None, history_generator=None, *args, **kwargs)

A class for storing market order history for serialization.

Attr list_type:This may be used in your logic to separate orders from history.
add_entry(entry)

Adds a MarketHistoryEntry instance to the list of market history entries contained within this instance. Does some behind-the-scenes magic to get it all ready for serialization.

Parameters:entry (MarketHistoryEntry) – The history entry to add to instance.
get_all_entries_grouped()

Uses a generator to return all grouped Item+Region combos, in the form of HistoryItemsInRegion instances. This is useful in that it is possible to express a lack of an item in a specific region.

Note

This is a generator!

Return type:generator
Returns:Generates a list of HistoryItemsInRegion instances, which contain MarketHistoryEntry instances.
get_all_entries_ungrouped()

Uses a generator to return all history entries within. MarketHistoryEntry objects are yielded directly, instead of being grouped in HistoryItemsInRegion instances.

Note

This is a generator!

Return type:generator
Returns:Generates a list of MarketHistoryEntry instances.
set_empty_region(region_id, type_id, generated_at, error_if_entries_present=True)

Prepares for the given region+item combo by instantiating a HistoryItemsInRegionList instance, which will track region ID, type ID, and generated time. This is mostly used for the JSON deserialization process in case there are no orders for the given region+item combo.

Parameters:
  • region_id (int) – The region ID.
  • type_id (int) – The item’s type ID.
  • generated_at (datetime.datetime) – The time that the order set was generated.
  • error_if_entries_present (bool) – If True, raise an exception if an entry already exists for this item+region combo when this is called. This failsafe may be disabled by passing False here.

HistoryItemsInRegionList

class emds.data_structures.HistoryItemsInRegionList(region_id, type_id, generated_at)

This is an intermediary container that stores MarketHistoryEntry for a particular item+region combo. The primary reason it exists is to store generation times for item+region combos that lack orders, since we can’t just yank from the first order’s time in that case.

Attr orders:A list of MarketHistoryEntry objects.
add_entry(entry)

Adds a MarketHistoryEntry instance to this region+item list.

Parameters:entry (MarketHistoryEntry) – The history entry to add to instance.

MarketHistoryEntry

class emds.data_structures.MarketHistoryEntry(type_id, region_id, historical_date, num_orders, low_price, high_price, average_price, total_quantity, generated_at)

Represents a single point of market history data.