MadeInPierre / finalynx

A minimalistic companion (CLI & web) to organize your investment portfolio, simulate its future, and reach your life goals.
https://finalynx.readthedocs.io
GNU General Public License v3.0
68 stars 13 forks source link

Using JSON format file for portfolio definition instead of python code #33

Closed nmathey closed 1 year ago

nmathey commented 1 year ago

Instead of using python code file (i.e. demo.py like) to define portfolio projects/goals, use JSON type file using similar folders/buckets structure (sample proposal):

{
"goal_name": "MyGoal",
"targets": {
      "targetMin": 2000,
      "targetRatio":10
 },
"products": {
       "product_name": {
             "name": "my_product_name",
             "key": "name_in_finary"
        }
 }
}
MadeInPierre commented 1 year ago

This could be a nice feature! Do you have examples of what this could be used for? I see the potential but I can't find anything specific on the top of my head 😅

Related discussions:

To implement this, we could create a parse subpackage inside finalynx/ which would provide import/export features. The final structure could look like this:

+ finalynx/
| - + parse/
|   |  __init__.py
|   |  json_import.py
| - portfolio/
| - ...
| - __main__.py

Then, we could add a rule in __main__.py to call Finalynx like this:

python -m finalynx your_config.json [options]

Would you be interested in developing the parser itself? 😄 It would take a JSON file as input and return a new Assistant instance ready to use.