py_alpaca_api.models.account_activity_model

Attributes

KEY_PROCESSORS

Classes

AccountActivityModel

Functions

extract_class_data(data_dict, field_processors, data_class)

Extracts and processes data from a dictionary based on a given data class and field processors.

account_activity_class_from_dict(→ AccountActivityModel)

Converts a dictionary into an instance of the AccountActivityModel.

Module Contents

py_alpaca_api.models.account_activity_model.KEY_PROCESSORS[source]
py_alpaca_api.models.account_activity_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:
  • data_dict (dict) – The dictionary containing the data to be processed.

  • field_processors (Dict) – A dictionary of field processors.

  • data_class (type[Any]) – The data class used to define the fields and types.

Returns:

A dictionary containing processed data, with keys corresponding to the fields of the data class.

Return type:

dict

Raises:

KeyError – When a field processor is not found for a specific data type.

class py_alpaca_api.models.account_activity_model.AccountActivityModel[source]
activity_type: str[source]
id: str[source]
cum_qty: float[source]
leaves_qty: float[source]
price: float[source]
qty: float[source]
side: str[source]
symbol: str[source]
transaction_time: datetime.datetime[source]
order_id: str[source]
type: str[source]
order_status: str[source]
date: datetime.datetime[source]
net_amount: float[source]
per_share_amount: float[source]
py_alpaca_api.models.account_activity_model.account_activity_class_from_dict(data_dict: dict) AccountActivityModel[source]

Converts a dictionary into an instance of the AccountActivityModel.

Parameters:

data_dict – A dictionary containing the data for creating an instance of AccountActivityModel.

Returns:

An instance of the AccountActivityModel class.

Raises:

None