def get_dividends(info=None): """Returns a list of dividend trasactions that include information such as the percentage rate, amount, shares of held stock, and date paid. :param info: Will filter the results to get a specific value. :type info: Optional[str] :returns: [list] Returns a list of dictionaries of key/value pairs for each divident payment. If info parameter is provided, \ a list of strings is returned where the strings are the value of the key that matches info. :Dictionary Keys: * id * url * account * instrument * amount * rate * position * withholding * record_date * payable_date * paid_at * state * nra_withholding * drip_enabled """ url = urls.dividends() data = helper.request_get(url, 'pagination') return(helper.filter(data, info))
def get_total_dividends(): """Returns a float number representing the total amount of dividends paid to the account. :returns: Total dollar amount of dividends paid to the account as a 2 precision float. """ url = urls.dividends() data = helper.request_get(url, 'pagination') dividend_total = 0 for item in data: dividend_total += float(item['amount']) return(dividend_total)
def get_dividends(info=None): """Returns a list of dividend trasactions that include information such as the percentage rate, amount, shares of held stock, and date paid. :param info: Will data_filter the results to get a specific value. :type info: Optional[str] :returns: Returns a list of dictionaries of key/value pairs for each divident payment. If info parameter is provided, \ a list of strings is returned where the strings are the value of the key that matches info. """ url = urls.dividends() data = helper.request_get(url, 'pagination') return helper.data_filter(data, info)