diff options
Diffstat (limited to 'README.org')
-rw-r--r-- | README.org | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/README.org b/README.org new file mode 100644 index 0000000..f0ff157 --- /dev/null +++ b/README.org | |||
@@ -0,0 +1,40 @@ | |||
1 | * Bitcoincharts Beancount converter | ||
2 | |||
3 | This is a quick tool I hacked together to convert historic bitcoin | ||
4 | prices from [[http://api.bitcoincharts.com/v1/csv/][bitcoincharts CSVs]] into beancount price directives. | ||
5 | |||
6 | The files are gzipped CSVs of (unixtime, price, tradeamount) | ||
7 | |||
8 | For each month with trades on the 1st, the tool calculates a weighted | ||
9 | average of trades on that day and outputs a beancount price directive. | ||
10 | |||
11 | ** Running | ||
12 | |||
13 | The tool does not download files on its own. Download the files | ||
14 | before running. | ||
15 | |||
16 | #+BEGIN_SRC shell | ||
17 | $ node index.js some.csv.gz | ||
18 | # or | ||
19 | $ node index.js some.csv.gz EUR | ||
20 | # or | ||
21 | $ node index.js some.csv.gz EUR BTC | ||
22 | #+END_SRC | ||
23 | |||
24 | *** Parameters | ||
25 | |||
26 | - filename (gzipped CSV) | ||
27 | - currency [optional] (currency code used in beancount {USD,EUR, etc}) | ||
28 | - commodity [optional] (currency code of commodity) {BTC,BCH,LTC, etc} | ||
29 | |||
30 | *** Status | ||
31 | |||
32 | It works. I don't plan on working on it much further. | ||
33 | |||
34 | It's not very efficent. I suspect the main problem is the group | ||
35 | function probably doesn't assume that the input is sorted and | ||
36 | therefore buffers its entire input. Patches welcome. | ||
37 | |||
38 | ** License | ||
39 | |||
40 | MIT | ||