Transactions module =================== Module ``transactions/transactions.py`` houses three classes that work on the live transaction ledger: * :class:`~richy.transactions.transactions.Performance` -- computes the Highcharts series for the *Assets* section of *Transactions*. * :class:`~richy.transactions.transactions.Transactions` -- pandas dataframing of the ledger, parent-chain tracing, root-investment pile computation. * :class:`~richy.transactions.transactions.Graph` -- per-transaction parent / child PNG diagram, persisted by the :func:`~richy.transactions.tasks.generate_graphs` task. Performance ----------- Its :meth:`~Performance.get_data` method returns the Highcharts series shown in the *Assets* section of *Transactions* -- the profit (or market-value) curve of each asset over the period it was held. Construct ``Performance(type, user=None, currency=None, profit=False, use_cache=True)``: * ``type`` -- one of ``"share"``, ``"index"``, ``"coin"``, ``"etf"``. * ``user`` -- restrict to a single user. If omitted, :meth:`~Performance.get_data` recomputes (and warms cache) for every user with matching holdings. * ``currency`` -- restrict to one currency. If omitted, every currency the user trades in is processed. * ``profit`` -- ``True`` returns the profit curve; ``False`` (default) returns the market-value curve. * ``use_cache`` -- when ``False``, cache is bypassed and recomputed. .. autoclass:: richy.transactions.transactions.Performance :show-inheritance: .. automethod:: richy.transactions.transactions.Performance.get_data Output structure from ``get_data()``:: [ { "name": "BTC", "data": [ [1504656000000, None], # Timestamp, price [1504742400000, None], [1504828800000, None], [1504915200000, None], ... ], }, { "name": "ETC", "data": [ [1545955200000, 422.4], [1546041600000, 415.2], [1546128000000, 424.8], [1546214400000, 404.0], [1546300800000, 418.4], ], }, ... ] Transactions ------------ .. autoclass:: richy.transactions.transactions.Transactions :show-inheritance: .. automethod:: richy.transactions.transactions.Transactions.get_transaction_basic_stats .. _transactions_get_pile_stats: .. automethod:: richy.transactions.transactions.Transactions.get_pile_stats Graph ----- .. autoclass:: richy.transactions.transactions.Graph :show-inheritance: .. automethod:: richy.transactions.transactions.Graph.generate .. automethod:: richy.transactions.transactions.Graph.export