Chris, thanks a lot! This is my new favourite price fetcher, by far.
And I like very much that you included information about each of the sources.
Of course, something has to go wrong the first time. The numbers I see below (ignore the expected errors) seem wrong - any ideas ?
10:07:43 ~$ for s in alphavantage coindesk coinmarketcap ecb yahoopricehist; do echo $s:; pricehist fetch $s ADA/USD -s 2021-06-30 -e 2021-07-01 -o ledger; done
alphavantage:
coindesk:
WARNING Available data covers the interval [2021-06-30--2021-06-30], which ends 1 day earlier than requested.
P 2021-06-30 00:00:00 ADA 35053.4183 USD
coinmarketcap:
WARNING No data found for the interval [2021-06-30--2021-07-01].
ecb:
P 2021-06-30 00:00:00 ADA 1.1884 USD
P 2021-07-01 00:00:00 ADA 1.1884 USD
yahoopricehist:
usage: pricehist fetch SOURCE PAIR [-h] [-t TYPE] [-s DATE | -sx DATE] [-e DATE | -ex DATE] [-o beancount|csv|gnucash-sql|ledger] [--invert] [--quantize INT] [--fmt-base SYM] [--fmt-quote SYM] [--fmt-time TIME] [--fmt-decimal CHAR] [--fmt-thousands CHAR] [--fmt-symbol rightspace|right|leftspace|left] [--fmt-datesep CHAR] [--fmt-csvdelim CHAR]
pricehist fetch: error: argument SOURCE: invalid choice: 'yahoopricehist' (choose from 'alphavantage', 'coindesk', 'coinmarketcap', 'ecb', 'yahoo')
10:07:54 ~$ for s in alphavantage coindesk coinmarketcap ecb yahoopricehist; do echo $s:; pricehist fetch $s TSLA/USD -s 2021-06-30 -e 2021-07-01 -o ledger; done
alphavantage:
coindesk:
WARNING Available data covers the interval [2021-06-30--2021-06-30], which ends 1 day earlier than requested.
P 2021-06-30 00:00:00 TSLA 35053.4183 USD
coinmarketcap:
WARNING No data found for the interval [2021-06-30--2021-07-01].
ecb:
P 2021-06-30 00:00:00 TSLA 1.1884 USD
P 2021-07-01 00:00:00 TSLA 1.1884 USD
yahoopricehist:
usage: pricehist fetch SOURCE PAIR [-h] [-t TYPE] [-s DATE | -sx DATE] [-e DATE | -ex DATE] [-o beancount|csv|gnucash-sql|ledger] [--invert] [--quantize INT] [--fmt-base SYM] [--fmt-quote SYM] [--fmt-time TIME] [--fmt-decimal CHAR] [--fmt-thousands CHAR] [--fmt-symbol rightspace|right|leftspace|left] [--fmt-datesep CHAR] [--fmt-csvdelim CHAR]
pricehist fetch: error: argument SOURCE: invalid choice: 'yahoopricehist' (choose from 'alphavantage', 'coindesk', 'coinmarketcap', 'ecb', 'yahoo')