py_alpaca_api.models.order_model
Attributes
Classes
Functions
|
Extracts and processes data from a dictionary based on a given data class and field processors. |
|
Process the legs and create a list of OrderModel objects based on the provided data. |
|
Creates an instance of OrderModel using the provided dictionary data. |
Module Contents
- py_alpaca_api.models.order_model.extract_class_data(data_dict: dict, field_processors: dict, data_class: type[Any])[source]
Extracts and processes data from a dictionary based on a given data class and field processors.
- Parameters:
- Returns:
A dictionary containing processed data, with keys corresponding to the fields of the data class.
- Return type:
- Raises:
KeyError – When a field processor is not found for a specific data type.
- class py_alpaca_api.models.order_model.OrderModel[source]
-
- created_at: datetime.datetime[source]
- updated_at: datetime.datetime[source]
- submitted_at: datetime.datetime[source]
- filled_at: datetime.datetime[source]
- expired_at: datetime.datetime[source]
- canceled_at: datetime.datetime[source]
- failed_at: datetime.datetime[source]
- replaced_at: datetime.datetime[source]
- py_alpaca_api.models.order_model.process_legs(legs: list[dict]) list[OrderModel][source]
Process the legs and create a list of OrderModel objects based on the provided data.
- Parameters:
legs (List[Dict]) – A list of dictionaries representing the legs.
- Returns:
A list of OrderModel objects generated from the leg data.
- Return type:
List[OrderModel]
Note
If the legs parameter is empty, an empty list will be returned.
- py_alpaca_api.models.order_model.order_class_from_dict(data_dict: dict) OrderModel[source]
Creates an instance of OrderModel using the provided dictionary data.
- Parameters:
data_dict (Dict) – A dictionary containing the data used to create the OrderModel instance.
- Returns:
An instance of OrderModel created using the provided data.
- Return type:
- Raises:
None –