portfolio-performance / portfolio

Track and evaluate the performance of your investment portfolio across stocks, cryptocurrencies, and other assets.
http://www.portfolio-performance.info
Eclipse Public License 1.0
2.96k stars 606 forks source link

Im- and export of all security meta data as JSON #2781

Open tquellenberg opened 2 years ago

tquellenberg commented 2 years ago

Is your feature request related to a problem? Please describe. The existing CSV im- and export of securities do not include all internal meta data. Especially attributes and taxonomy assignments are not included.

Describe the solution you'd like New JSON format like this. Most of the data is optional. Existing securities are updated (referenced by ISIN) when JSOn is imported.

{
  "version": "1.0",
  "type": "SecurityMetaData",
  "securities": [
    {
      "isin": "US0378331005",
      "name": "Apple Inc",
      "currencyCode": "EUR",
      "note": "Meine Anmerkungen...",
      "tickerSymbol": "APC.DE",
      "wkn": "",
      "properties": {},
      "attributes": {},
      "taxonomies": [
        {
          "name": "Regionen (MSCI)",
          "assignments": [
            {
              "key": "RW1",
              "path": [
                "Regionen (MSCI)",
                "Welt",
                "Amerikas"
              ],
              "weight": 9000
            },
            {
              "key": "RW2",
              "path": [
                "Regionen (MSCI)",
                "Welt",
                "Europa"
              ],
              "weight": 1000
            }
          ]
        }
      ]
    }
  ]
}
  1. Maybe the structure for the taxonomies is too complex and a more simples approach is better (flat list of assignments)
  2. Is the header with version and type needed?

Some of the related discussions can be found here: https://forum.portfolio-performance.info/t/automatische-erstellung-von-klassifizierungen/2969/51

flywire commented 2 years ago

See also #2700

pfalcon commented 1 year ago

https://github.com/portfolio-performance/portfolio/issues/2216#issuecomment-1703819271 offers much better solution - import/export to an SQLite database. Such database can be directly operated on to do many useful things, or well, a script can be written to export/import its contents to some custom JSON.