py_alpaca_api.models.snapshot_model =================================== .. py:module:: py_alpaca_api.models.snapshot_model Classes ------- .. autoapisummary:: py_alpaca_api.models.snapshot_model.QuoteModel py_alpaca_api.models.snapshot_model.TradeModel py_alpaca_api.models.snapshot_model.BarModel py_alpaca_api.models.snapshot_model.SnapshotModel Functions --------- .. autoapisummary:: py_alpaca_api.models.snapshot_model.quote_class_from_dict py_alpaca_api.models.snapshot_model.trade_class_from_dict py_alpaca_api.models.snapshot_model.bar_class_from_dict py_alpaca_api.models.snapshot_model.snapshot_class_from_dict Module Contents --------------- .. py:class:: QuoteModel .. py:attribute:: symbol :type: str .. py:attribute:: timestamp :type: datetime.datetime .. py:attribute:: ask :type: float .. py:attribute:: ask_size :type: int .. py:attribute:: bid :type: float .. py:attribute:: bid_size :type: int .. py:function:: quote_class_from_dict(data_dict: dict) -> QuoteModel :param 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.: .. py:class:: TradeModel Model for individual stock trade data. .. py:attribute:: timestamp :type: str .. py:attribute:: symbol :type: str .. py:attribute:: exchange :type: str .. py:attribute:: price :type: float .. py:attribute:: size :type: int .. py:attribute:: conditions :type: list[str] | None .. py:attribute:: id :type: int .. py:attribute:: tape :type: str .. py:function:: trade_class_from_dict(data: dict[str, Any], symbol: str | None = None) -> TradeModel Create TradeModel from API response dictionary. :param data: Dictionary containing trade data from API :param symbol: Optional symbol to use if not in data :returns: TradeModel instance .. py:class:: BarModel .. py:attribute:: timestamp :type: str .. py:attribute:: open :type: float .. py:attribute:: high :type: float .. py:attribute:: low :type: float .. py:attribute:: close :type: float .. py:attribute:: volume :type: int .. py:attribute:: trade_count :type: int | None :value: None .. py:attribute:: vwap :type: float | None :value: None .. py:class:: SnapshotModel .. py:attribute:: symbol :type: str .. py:attribute:: latest_trade :type: py_alpaca_api.models.trade_model.TradeModel | None :value: None .. py:attribute:: latest_quote :type: py_alpaca_api.models.quote_model.QuoteModel | None :value: None .. py:attribute:: minute_bar :type: BarModel | None :value: None .. py:attribute:: daily_bar :type: BarModel | None :value: None .. py:attribute:: prev_daily_bar :type: BarModel | None :value: None .. py:function:: bar_class_from_dict(data: dict) -> BarModel .. py:function:: snapshot_class_from_dict(data: dict) -> SnapshotModel