Skip to content

Instantly share code, notes, and snippets.

@simonmichael simonmichael/1-Makefile
Last active Mar 8, 2019

Embed
What would you like to do?
make rules and short symbols setup for market-prices.py (https://github.com/barrucadu/hledger-scripts#market-prices)
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)
{ "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": "$"
}
}
$ 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
You can’t perform that action at this time.