Bitcoincharts Beancount converter
 
Go to file
Alan Pearce 269e7b208e
Initial commit
2017-09-16 17:31:00 +02:00
.gitignore Initial commit 2017-09-16 17:31:00 +02:00
LICENSE Initial commit 2017-09-16 17:31:00 +02:00
README.org Initial commit 2017-09-16 17:31:00 +02:00
index.js Initial commit 2017-09-16 17:31:00 +02:00
package-lock.json Initial commit 2017-09-16 17:31:00 +02:00
package.json Initial commit 2017-09-16 17:31:00 +02:00

README.org

Bitcoincharts Beancount converter

This is a quick tool I hacked together to convert historic bitcoin prices from bitcoincharts CSVs into beancount price directives.

The files are gzipped CSVs of (unixtime, price, tradeamount)

For each month with trades on the 1st, the tool calculates a weighted average of trades on that day and outputs a beancount price directive.

Running

The tool does not download files on its own. Download the files before running.

$ node index.js some.csv.gz
# or
$ node index.js some.csv.gz EUR
# or
$ node index.js some.csv.gz EUR BTC

Parameters

  • filename (gzipped CSV)
  • currency [optional] (currency code used in beancount {USD,EUR, etc})
  • commodity [optional] (currency code of commodity) {BTC,BCH,LTC, etc}

Status

It works. I don't plan on working on it much further.

It's not very efficent. I suspect the main problem is the group function probably doesn't assume that the input is sorted and therefore buffers its entire input. Patches welcome.

License

MIT