py_alpaca_api.models.watchlist_model ==================================== .. py:module:: py_alpaca_api.models.watchlist_model Attributes ---------- .. autoapisummary:: py_alpaca_api.models.watchlist_model.KEY_PROCESSORS Classes ------- .. autoapisummary:: py_alpaca_api.models.watchlist_model.AssetModel py_alpaca_api.models.watchlist_model.WatchlistModel Functions --------- .. autoapisummary:: py_alpaca_api.models.watchlist_model.extract_class_data py_alpaca_api.models.watchlist_model.process_assets py_alpaca_api.models.watchlist_model.watchlist_class_from_dict Module Contents --------------- .. py:class:: AssetModel .. py:attribute:: id :type: str .. py:attribute:: asset_class :type: str .. py:attribute:: easy_to_borrow :type: bool .. py:attribute:: exchange :type: str .. py:attribute:: fractionable :type: bool .. py:attribute:: maintenance_margin_requirement :type: float .. py:attribute:: marginable :type: bool .. py:attribute:: name :type: str .. py:attribute:: shortable :type: bool .. py:attribute:: status :type: str .. py:attribute:: symbol :type: str .. py:attribute:: tradable :type: bool .. py:data:: KEY_PROCESSORS .. py:function:: extract_class_data(data_dict: dict, field_processors: dict, data_class: type[Any]) Extracts and processes data from a dictionary based on a given data class and field processors. :param data_dict: The dictionary containing the data to be processed. :type data_dict: dict :param field_processors: A dictionary of field processors. :type field_processors: Dict :param data_class: The data class used to define the fields and types. :type data_class: type[Any] :returns: A dictionary containing processed data, with keys corresponding to the fields of the data class. :rtype: dict :raises KeyError: When a field processor is not found for a specific data type. .. py:class:: WatchlistModel .. py:attribute:: id :type: str .. py:attribute:: account_id :type: str .. py:attribute:: created_at :type: datetime.datetime .. py:attribute:: updated_at :type: datetime.datetime .. py:attribute:: name :type: str .. py:attribute:: assets :type: list[py_alpaca_api.models.asset_model.AssetModel] .. py:function:: process_assets(assets: list[dict]) -> list[py_alpaca_api.models.asset_model.AssetModel] Process a list of assets. This function takes a list of asset dictionaries and returns a list of AssetModel objects. Each asset dictionary should contain the necessary information to create an AssetModel object. :param assets: A list of asset dictionaries. :type assets: List[Dict] :returns: A list of AssetModel objects. :rtype: List[AssetModel] .. py:function:: watchlist_class_from_dict(data_dict: dict) -> WatchlistModel :param data_dict: A dictionary containing the data needed to create a WatchlistModel object. :returns: A new instance of the WatchlistModel created from the data in the input dictionary.