py_alpaca_api.models.account_model

Attributes

KEY_PROCESSORS

Classes

AccountModel

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_class_from_dict(→ AccountModel)

Converts a dictionary into an instance of the AccountModel.

Module Contents

py_alpaca_api.models.account_model.KEY_PROCESSORS[source]
py_alpaca_api.models.account_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_model.AccountModel[source]
id: str[source]
account_number: str[source]
status: str[source]
crypto_status: str[source]
options_approved_level: int[source]
options_trading_level: int[source]
currency: str[source]
buying_power: float[source]
regt_buying_power: float[source]
daytrading_buying_power: float[source]
effective_buying_power: float[source]
non_marginable_buying_power: float[source]
options_buying_power: float[source]
bod_dtbp: float[source]
cash: float[source]
accrued_fees: float[source]
pending_transfer_in: float[source]
portfolio_value: float[source]
pattern_day_trader: bool[source]
trading_blocked: bool[source]
transfers_blocked: bool[source]
account_blocked: bool[source]
created_at: datetime.datetime[source]
trade_suspended_by_user: bool[source]
multiplier: int[source]
shorting_enabled: bool[source]
equity: float[source]
last_equity: float[source]
long_market_value: float[source]
short_market_value: float[source]
position_market_value: float[source]
initial_margin: float[source]
maintenance_margin: float[source]
last_maintenance_margin: float[source]
sma: float[source]
daytrade_count: int[source]
balance_asof: str[source]
crypto_tier: int[source]
intraday_adjustments: int[source]
pending_reg_taf_fees: float[source]
py_alpaca_api.models.account_model.account_class_from_dict(data_dict: dict) AccountModel[source]

Converts a dictionary into an instance of the AccountModel.

Parameters:

data_dict (dict) – A dictionary containing the data for the AccountModel instance.

Returns:

An instance of the AccountModel created from the provided dictionary.

Return type:

AccountModel