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
MarketItemsInRegionListinstances. 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 MarketItemsInRegionListinstances, which containMarketOrderinstances.
-
get_all_orders_ungrouped()¶ Uses a generator to return all orders within.
MarketOrderobjects are yielded directly, instead of being grouped inMarketItemsInRegionListinstances.Note
This is a generator!
Return type: generator Returns: Generates a list of MarketOrderinstances.
-
set_empty_region(region_id, type_id, generated_at, error_if_orders_present=True)¶ Prepares for the given region+item combo by instantiating a
MarketItemsInRegionListinstance, 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
MarketOrderinstance 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
HistoryItemsInRegioninstances. 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 HistoryItemsInRegioninstances, which containMarketHistoryEntryinstances.
-
get_all_entries_ungrouped()¶ Uses a generator to return all history entries within.
MarketHistoryEntryobjects are yielded directly, instead of being grouped inHistoryItemsInRegioninstances.Note
This is a generator!
Return type: generator Returns: Generates a list of MarketHistoryEntryinstances.
-
set_empty_region(region_id, type_id, generated_at, error_if_entries_present=True)¶ Prepares for the given region+item combo by instantiating a
HistoryItemsInRegionListinstance, 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
MarketHistoryEntryinstance to this region+item list.Parameters: entry (MarketHistoryEntry) – The history entry to add to instance.
-