py_alpaca_api.models.quote_model

Attributes

KEY_PROCESSORS

Classes

QuoteModel

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.

quote_class_from_dict(→ QuoteModel)

param data_dict:

A dictionary containing data for creating an instance of QuoteModel.

Module Contents

py_alpaca_api.models.quote_model.KEY_PROCESSORS[source]
py_alpaca_api.models.quote_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.quote_model.QuoteModel[source]
symbol: str[source]
timestamp: datetime.datetime[source]
ask: float[source]
ask_size: int[source]
bid: float[source]
bid_size: int[source]
py_alpaca_api.models.quote_model.quote_class_from_dict(data_dict: dict) QuoteModel[source]
Parameters:

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

Returns:

An instance of QuoteModel created using the data from data_dict.

Raises:

None.