Missing info for ETFs
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.
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.