-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Annual Net Expense Ratio to Ticker Info #1769
base: dev
Are you sure you want to change the base?
Conversation
Revert the last commit and rebase to |
edeb77c
to
4e7344a
Compare
updated base.py ticker to accommodate mutual funds and ETFs to show annualNetExpenseRatio in ticker.info
@ValueRaider branch is rebased, history is clean with single commit. |
Can you wrap the GET in a Regarding refactor, there is a plan #1755. |
@@ -1751,6 +1751,10 @@ def get_mutualfund_holders(self, proxy=None, as_dict=False): | |||
def get_info(self, proxy=None) -> dict: | |||
self._quote.proxy = proxy or self.proxy | |||
data = self._quote.info | |||
if data['quoteType'] == 'ETF': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This excludes mutual funds (MUTUALFUND
)
ff314af
to
443161d
Compare
Checks for existence of 'Expense Ratio (net)' of mutual funds and ETF tickers and adds metric retroactively to
Ticker.info
attribute throughTickerBase.get_info()
method as'annualNetExpenseRatio'
as requested and resolves #801.Change uses
TickerBase.get_institutional_holders()
which returns a dictionary with row info['Net Assets', 'NAV', 'PE Ratio (TTM)', 'Yield', 'YTD Daily Total Return', 'Beta (5Y Monthly)', 'Expense Ratio (net)', 'Inception Date']
for mutual funds and ETF tickers.This may be a bug, as these dictionary contents have nothing to do with institutional holders of mutual funds and ETFs as they do not have any listed under Holdings. These stats are located on the summary page of mutual funds and ETFs on finance.yahoo.com see Vanguard 500 Index Fund (VOO) as example, Holdings tab of mutual funds and ETFs show Overall Portfolio Composition (%), Sector Weightings (%), Equity Holdings, Bond Ratings, and Top 9 Holdings.
From testing it shows that
TickerBase
class methodsget_major_holders()
returns information from the first column of the summary page andget_institutional_holders()
returns information from the second column of the summary page for mutual funds and ETFs.This is a temporary fix, but further action will likely require a code refactor of considerable scale.