Domicile: I would like to inquire whether it is possible to set up and query the “domicile” field as well. I believe this would be significant for many people. For example, if someone dies with $60,000 in assets with a U.S. domicile, their heirs will have to pay estate tax. For this reason, it wouldn’t hurt to check this as well.
Furthermore, it could be significant from a tax perspective as well, because, for example, in the case of GB and IE domiciles, no withholding tax is deducted, but in the case of DE, NL, and FR, for example, 15% is deducted based on my country’s double taxation agreement…
If this can be implemented, I think it would be a very useful feature.
I still had the issue with connection errors. For me it looks like something on morningstar side eg. loadbalancer switching to another server or something similar. With the help of AI I changed the requests.get calls to requests_get_with_retry. This works fine for me. If you want I can send you the file
see attached zip file. 8 requests.get-calls have been replaced with requests_get_with_retry calls. There are 5 retries with increasing waiting time (5s, 10s, 15s, 20s, 25s). Looks like this:
[ISHARES CORE EM IMI ACC]:
@ Retrieving data for fund IE00BKM4GZ66 from Morningstar API
(Name: “iShares Core MSCI EM IMI ETF USD Acc”)
(Ongoing Charge IE00BKM4GZ66: 0.18%)
(Fund type: “Equity”)
Connection error, retrying in 5s… (attempt 1/5)
For “my version” of the script, please go to github and download the new-api-branch of the script.
The link is in the following post:
Unfortunately, I haven’t properly updated the README yet for that branch. But it would need to contain something like this:
Installation
Requires Python 3 (and Portfolio Performance).
Steps:
download this repository from github (aka: git clone this repository)
run pip3 install -r requirements.txt in the install directory
test the script by running: python portfolio-classifier.py test/multifaktortest.xml -stocks in the install directory. Then open the resulting file pp_classified.xml in Portfolio Performance.
Note: You might want to install and run this in a Python virtual environment.Make sure you have venv installed and cd to the install directory.Run python -m venv ppc-env(ppc-env is then the name of the new virtual environment).Run source ppc-env/bin/activate to enter the virtual environment.Run pip3 install -r requirements.txt (as in step 2 above).Use the script (as e.g. in step 3 above).When done, exit the virtual environment with deactivate.
Command Line Parameters
For the most recent set of command line parameters run: python portfolio-classifier.py -h
And then please read the “How it works” chapter in the existing README.
Hope that helps.
(And if you would like to have some pre-defined colours for the taxonomies, have a look at the files in pp-portfolio-classifier/docs/taxonomy-json-templates/ and use e.g. AllTaxonomies.json. Best before even running the script for the first time).
For some reason you still have the main branch. The new-api-branch does not have this error message. Check the file portfolio-classifier.py. The file on new-api-branch is almost double the size (~102 kB vs ~59 kB) and has about 2250 lines of code (main has only about 1150). It is sufficient, if you just replace this file with the new-api-branch version.
(I don’t think that Mac, Linux or Windows matters. Python should work similarly on all.)
I tried your scrip and it was working well on a small Portfolio (with 18 etf/shares). But if I’m running it on a larger portfolio (43 etf/shares/bonds) I get the error message:
Loading XML file: XXX.xml
TypeError: sec.note.match is not a function
at ….node_modules\pp-portfolio-classifier\dist\xml-helper.js:90:44
at Array.map ()
at XMLHandler.getSecurities (….node_modules\pp-portfolio-classifier\dist\xml-helper.js:79:56)
at main (…\node_modules\pp-portfolio-classifier\dist\index.js:68:35)
at Object. (…node_modules\pp-portfolio-classifier\dist\index.js:95:1)
at Module._compile (node:internal/modules/cjs/loader:1830:14)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
I have about 170 etf/shares/bonds actives in my portfolio without problem.
I think that the problem should be related to the note field content of one of your assets.
But you will only get Industries below Technology sector.
This is an interesting feature that could be implemented.
2/ I didn’t neither, that’s why it not active in the default configuration . I need to investigate more.
3/ all available views are listed in `docs/views.xml`. The Top100 view doesn’t exist. But a contributor send me a patch for this feature that I will try to publish in the next following days.
Regards