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

Missing info for ETFs #1640

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

ricardoprins
Copy link
Contributor

Fixes #244.

Some ETF information was not being pulled, because it was being stored at a different place. After reading #248, #557, and playing around with the URL endpoint, I noticed that the parameter fundProfile was not being pulled.

This fix simply adds the parameter to the fetch method, which will pull the data.

Here's the response sample for the contents of fundProfile for the VTI ticker:

"fundProfile": {
	"maxAge": 1,
	"styleBoxUrl": "https://s.yimg.com/lq/i/fi/3_0stylelargeeq2.gif",
	"family": "Vanguard",
	"categoryName": "Large Blend",
	"legalType": "Exchange Traded Fund",
	"managementInfo": {
		"managerName": null,
		"managerBio": null,
		"startdate": {}
	},
	"feesExpensesInvestment": {
		"annualReportExpenseRatio": {
			"raw": 4.0E-4,
			"fmt": "0.04%"
		},
		"frontEndSalesLoad": {},
		"deferredSalesLoad": {},
		"twelveBOne": {},
		"netExpRatio": {},
		"grossExpRatio": {},
		"annualHoldingsTurnover": {
			"raw": 0.03,
			"fmt": "3.00%"
		},
		"totalNetAssets": {
			"raw": 134308.94,
			"fmt": "134,308.94"
		},
		"projectionValues": {}
	},
	"feesExpensesInvestmentCat": {
		"annualReportExpenseRatio": {
			"raw": 0.0036000002,
			"fmt": "0.36%"
		},
		"frontEndSalesLoad": {},
		"deferredSalesLoad": {},
		"twelveBOne": {},
		"annualHoldingsTurnover": {
			"raw": 50.76,
			"fmt": "5,076.00%"
		},
		"totalNetAssets": {
			"raw": 134308.94,
			"fmt": "134,308.94"
		},
		"projectionValuesCat": {}
	},
	"initInvestment": {},
	"initIraInvestment": {},
	"initAipInvestment": {},
	"subseqInvestment": {},
	"subseqIraInvestment": {},
	"subseqAipInvestment": {},
	"brokerages": []
}

As I mentioned above, this will simply pull the data; at this point, the question would be whether to add or not some feature that handles the data above in any specific way after detecting that a given ticker is an ETF, which I think would just add more complexity to the way data is being handled in this module.

With this fix, calling ticker.info['feesExpensesInvestment']['annualReportExpenseRatio'] would yield the desired return.

@ValueRaider
Copy link
Collaborator

ValueRaider commented Aug 3, 2023

the question would be whether to add or not some feature that handles the data above in any specific way ..., which I think would just add more complexity

My philosophy with yfinance is it should provide good quality data to plug into workflows, not simply forward what Yahoo returns (can use yahooquery for that). Yahoo doesn't always return great data. If most/all users would perform same post-processing then easier for everyone if yfinance does it. So additional complexity is fine if justified.

If you have something specific in mind, you can always commit it for review (but don't squash) because can always rollback.

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