Automatic import of classifications

Hi all, hi @Alfons1Qvor12,

I am looking for your feedback with the automatic import of classifications via JSON. With Version 0.78.0, you can export a taxonomy to JSON.

The option is in the upper right corner:

The format looks like like the one below - it has a block categoriesand a block instruments:

{
  "name": "Asset Classes",
  "categories": [
    {
      "name": "Cash",
      "key": "CASH",
      "color": "#c437c2"
    },
    {
      "name": "Equity",
      "key": "EQUITY",
      "color": "#5757ff",
      "children": [ ... ]
    }
  ],
  "instruments": [
    {
      "identifiers": {
        "name": "iShares Core Euro Government Bond UCITS ETF (Dist)",
        "isin": "IE00B4WXJJ64",
        "wkn": "A0RL83",
        "ticker": "EUNH.DE"
      },
      "categories": [
        {
          "key": "EQUITY",
          "path": [
            "Equity"
          ],
          "weight": 100.0
        }
      ]
    }
  ]
}

In the same format, one can import taxonomies.

This is the behavior when importing:

  • It will use the category “key” to find the category
  • If it cannot be found by key, then the import will try to find it by path
  • If it cannot be found neither by key nor path, a new category will be created - with the location based on the path
  • Instruments are searched first by ISIN, then by ticker, then by WKN, and finally by name
  • If the instrument is not found, no new instrument will be created (the idea is that one can apply a taxonomy to one owns set of instrument - not to import all instruments)
  • You can choose to not update name, description, and color when importing (the idea is that one might locally name the categories - country names - and does not want the import to overwrite the names every time - that makes sense when using the category “key” as identifier - say the two digit ISO identifier of the country)
  • Based on this: the “path” element in the “instruments” section is not needed if the key is given and all categories have keys. One also does not have to give all identifiers for an instrument (ISIN, ticker) but only the ones available.

My plan is to keep this format stable - once I updated it with your feedback. Then the script could generate a JSON file and allow an easier import into your “productive” PP file.

1 Like