Closed trevorld closed 5 years ago
I think something like
$ bean-query -f csv example.beancount "select date, flag as mark, account, payee, narration as description, number as amount, currency as commodity, cost(position), value(position), tags" | csvlook | head
|-------------+------+----------------------------+-------------+--------------------------------+----------+-----------+---------------+----------------+-------------|
| date | mark | account | payee | description | amount | commodity | cost_position | value_position | tags |
|-------------+------+----------------------------+-------------+--------------------------------+----------+-----------+---------------+----------------+-------------|
| 2015-12-31 | * | Assets:JT-Checking | | Opening Balances | 5000.00 | USD | 5000.00 USD | 5000.00 USD | |
| 2015-12-31 | * | Equity:Opening | | Opening Balances | -5000.00 | USD | -5000.00 USD | -5000.00 USD | |
| 2016-01-01 | * | Assets:JT-Checking | Landlord | Rent | -1500.00 | USD | -1500.00 USD | -1500.00 USD | |
| 2016-01-01 | * | Expenses:Shelter:Rent | Landlord | Rent | 1500.00 | USD | 1500.00 USD | 1500.00 USD | |
| 2016-01-01 | * | Assets:JT-Checking | Brokerage | Buy Stock | -1000 | USD | -1000 USD | -1000 USD | |
| 2016-01-01 | * | Equity:Transfer | Brokerage | Buy Stock | 1000 | USD | 1000 USD | 1000 USD | |
| 2016-01-01 | * | Assets:JT-Brokerage | Brokerage | Buy Stock | 4 | SP | 1000 USD | 2000 USD | |
gets us what we need (and splitting up the cost_position and value_position into historical_cost, hc_commodity, market_value, and mv_commodity should be straightforward).
Currently use either
bean-report (h)ledger
and then eitherledger csv
orhledger register -o csv
. Right nowbean-query "SELECT *"
doesn't give me what I want/need (in particular missing the crucial account field plus parsing historical cost and/or market values look like could be a bit of a pain as well):