bankroll-py / bankroll

Ingest portfolio and other data from multiple brokerages, and analyze it
MIT License
60 stars 6 forks source link

Split up project into separate components + responsibilities #101

Closed jspahrsummers closed 5 years ago

jspahrsummers commented 5 years ago

In trying to build another project which wants to use pieces of bankroll, I'm finding the current structure kind of unwieldy, and don't want to risk this becoming a kitchen sink. At bare minimum, we should probably separate the model from the brokerage support from the analysis and tools.

Something like this, although not necessarily as finely-sliced:

component graph

digraph {
  rankdir = BT;
  { rank = min; model; }
  { rank = same; ibkr; schwab; fidelity; vanguard; }
  { rank = same; analysis, "plugin framework" }
  { rank = max; cli, notebooks }
  ibkr, schwab, fidelity, vanguard -> model
  ibkr, schwab, fidelity, vanguard -> "plugin framework" [style=dashed]
  analysis -> model
  notebooks -> analysis, "plugin framework"
  cli -> analysis, "plugin framework"
}
jspahrsummers commented 5 years ago

Creating things under https://github.com/bankroll-py

jspahrsummers commented 5 years ago

Started thinking about how to isolate third-party dependencies to as small a region as possible, so I ended up adding a marketdata component:

digraph {
  rankdir = BT;
  { rank = min; model; }
  { rank = same; ibkr; schwab; fidelity; vanguard; }
  { rank = max; cli, notebooks }
  ibkr, schwab, fidelity, vanguard, marketdata -> model
  ibkr, schwab, fidelity, vanguard -> "plugin framework" [style=dashed]

  ibkr -> marketdata [style=dashed]
  ibkr -> ib_insync
  marketdata -> rx
  rx [style=dotted]
  ib_insync [style=dotted]

  analysis -> model
  analysis -> pandas
  pandas [style=dotted]

  notebooks -> analysis, "plugin framework", marketdata
  cli -> analysis, "plugin framework", marketdata
}

graphviz

jspahrsummers commented 5 years ago

Not really happy with this generic analysis component, though. Feels like it'll just be a dumping ground. @joshvera, any thoughts on how to proceed in that area specifically?

jspahrsummers commented 5 years ago

To do:

jspahrsummers commented 5 years ago

I suppose we can just put all the analysis bits into the CLI and notebooks repo for now, since those things will all be used in concert anyways (and the value of analysis to other software is dubious).