Last active
August 29, 2021 19:37
-
-
Save simonmichael/9ca4d74b30567dcc3b93763ffe88abf9 to your computer and use it in GitHub Desktop.
make rules and short symbols setup for market-prices.py (https://github.com/barrucadu/hledger-scripts#market-prices)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YEAR:=$(shell date +%Y) | |
PRICES=$(YEAR).prices | |
# Fetch latest market prices, add P records to prices file. | |
MARKET_PRICES=~/src/PLAINTEXTACCOUNTING/hledger-scripts/market-prices/market-prices.py <market-prices.json | |
.PHONY: prices prices-dry | |
prices-dry: | |
@$(MARKET_PRICES) | |
prices: | |
@$(MARKET_PRICES) >>$(PRICES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "commodities": | |
{ "BTC": { "provider": "coinbase" } | |
, "ETH": { "provider": "coinbase" } | |
, "E": { "base": "EUR", "provider": "ft_currency" } | |
, "P": { "base": "GBP", "provider": "ft_currency" } | |
, "Y": { "base": "JPY", "provider": "ft_currency" } | |
} | |
, "symbols": | |
{ "USD": "$" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ make prices-dry | |
P 2019-03-08 BTC $3891.995 | |
P 2019-03-08 ETH $137.005 | |
P 2019-03-08 E $1.1242 | |
P 2019-03-08 P $1.3014 | |
P 2019-03-08 Y $0.009 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment