Automatic import of classifications

So the only major issue I see seems to be the “Holding” taxonomy, which (in my US-portfolio) misses almost everything. Other taxonomies are much better. Even very large & popular ETFs are almost entirely unclassified, i.e.

VTI (59% unclassified)
VT (82% unclassified)
VXUS (67% unclassified)
etc.

Hello everybody,

I am a happy user of portfolio-classifier.py. For my personal use, I have rewritten part of the code so that it now updates existing xml entries rather than creating new ones. This is very convenient as it keeps colors and balancing weights etc. I also added a few nice other features like skipping entries with zero weight, rounding to 100% when the sums are slightly above, etc. It also doesn’t delete entries like holdings when no information can be fetched from MS.

I wonder what would be a good way to share this with others (though I don’t plan to maintain this). Should I just dump it on github? Shoud I give it a new name (like portfolio-classifier-v2)? Should I send the code to the original authors so that they integrate whatever they like? Are there any legal constraints or potential traps?

Any suggestions/ideas?

Thanks a lot!

2 Likes

Hi,

really appreciate your effort! Thank you!

Personally, I would get in touch with the original author and try to work something out with him. Maybe you two will find a good way on how to go forward from here.

It seems to me that there are multiple versions maintained by different people in paralell …

Well, from whom did you pulled your fork? This would be the first person to talk too. But that’s just me personal view.

My guess: fbuchinger is the original author. If I remember correctly, I took the fork from fizban99.

Indeed @fizban was the one making use of morningstar data. Maybe it makes sense to talk to him… But let me stress this one more time, this is just my view on things… genuinely you can place it on github and that’s it.

1 Like

hi, that’s great, I would definitely be interested !
cheers

1 Like

Huge thanks for modifying the code and for offering to make this available to others. It would be great if I could use it…

That’s great! A lot of people are waiting for this “data-update” feature. I also tried to extend the existing script. Getting data was not the problems, but I did not understand how to change the xml data to save it.

I was waiting for PP to get API access feature to easily make changes in PP projects without the need of understanding XML structure. Like: [new] REST API for Portfolio Performance · Issue #2085 · portfolio-performance/portfolio · GitHub
But utill now, I guess PP has not got API access support.

Great that you have implemented the update!

Would be great when you release it on github. I guess correct would be as fork. I think to release it as public fork you don’t have to ask the creator, right? As I know, all previous creator/coder on the scripts are (unfortunately) not active anymore. They (in my opinion and unfortunately) also do not write in this thread anymore. But I could be wrong and some of them will answer.
If not, do it as fork … or, if you changed most code or all of the code, then as new project.

Would be also great, if you can put a lot of comments inside the code. This would make it easier for people like me who can code but are not professionals, to quickly dive into it and may help. Especially on the topics how data are saved and why things are solved like this.

Thanks a lot

Thanks @Manni79. I think you are right, sharing it via a public fork is Github is probably the right way to go. I think this is the idea of Github on how to contribute to such a project and people can then pick whatever they need from my code modifications.
(And: Yes, I have a few comments in the code and the script is also quite talkative towards the user. The code is not as elegant as the original, but I tried my best not to make it too clumsy).

Hello everybody,

Here it is now: GitHub - Alfons1Qto12/pp-portfolio-classifier: automatic classification of ETFs in Portfolio Performance using holding lists with redesigned add_taxonomy so that it updates existing xml files.

If you run it for the first time with existing xml from a previous version, please note the compatibility issue for the corrected name of the geographic region “Europe Emerging”. I recommend to adapt manually before you run the script.

Cheers

Hello everybody,

I struggle to understand why the MorningStar data in portfolio-classifier.py does not contain countries like Saudi Arabia, Qatar, Kuwait, UAE and Egypt. Is there is a mistake in how portfolio-classifier.py fetches data from MorningStar or is the data provider just not providing data on these countries? Please let me know, if you have some facts on this topic.

Thanks

Why did you not check the Morningstar website directly? However, if the funds does not provide a country allocation, how should this mapped?

I don’t find any page which tells for which countries they are providing data. I am not interested in a specific ETF or fond. But you are right, I could check for a specific Middle East ETF what kind of country information they provide for that.

Just for the records and as example for iShares MSCI Saudi Arabia Capped UCITS ETF. Neither https://www.ishares.com/de/privatanleger/de/produkte/279996/ishares-msci-saudi-arabia-capped-imi-ucits-etf
nor https://www.morningstar.com/etfs/arcx/ksa/quote has published any country allocation…

https://www.ishares.com/de/privatanleger/de/produkte/308477/fund/1478358465952.ajax?fileType=csv&fileName=IUSW_holdings&dataType=fund

In the holdings-csv is always a country information.

@Rafa: Yes, and on the snapshot page, it provides even country information, but only for 51 countries all with 0% and Saudi Arabia not being one of them. So indeed, it seems that Morningstar does not map ETFs and fonds to those countries.

@ProgFriese : Thanks. Yes, I also see e.g. on Instant X-Ray that also MorningStar provides mapping of individual holdings to such countries. But unfortunately not for ETFs and fonds.

To sum this up: It seems that MorningStar provides mapping of ETFs and fonds to a list of 51 countries (several Middle East countries not being on that list). I see all those 51 countries in my data from portfolio-classifier.py. So in that sense, it is complete.

(In theory, it could also be iShares and other asset managers who do not provide the data, as in the example from Rafa. But as the MorningStar snapshot webpage shows a list of 51 countries all with 0% for the iShares MSCI Saudia Arabia ETF, it seems plausible that this is the complete list of MorningStar.)