Skip to content
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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

ChNgineer
Copy link

@ChNgineer ChNgineer commented Dec 9, 2023

Checks for existence of 'Expense Ratio (net)' of mutual funds and ETF tickers and adds metric retroactively to Ticker.info attribute through TickerBase.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 methods get_major_holders() returns information from the first column of the summary page and get_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.

@ValueRaider
Copy link
Collaborator

Revert the last commit and rebase to dev, instructions in #1084. Keeps history clean.

@ChNgineer ChNgineer force-pushed the netER-info branch 5 times, most recently from edeb77c to 4e7344a Compare December 9, 2023 22:27
updated base.py ticker to accommodate mutual funds and ETFs to show annualNetExpenseRatio in ticker.info
@ChNgineer
Copy link
Author

@ValueRaider branch is rebased, history is clean with single commit.

@ValueRaider
Copy link
Collaborator

Can you wrap the GET in a if ETF or mutual fund? Should be something in info[] that tells.

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':
Copy link
Collaborator

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants