hledger-stockquotes-0.1.1.0: Generate HLedger Price Directives From Daily Stock Quotes.
Safe HaskellNone
LanguageHaskell2010

Hledger.StockQuotes

Description

Helper functions for the hledger-stockquotes application.

Synopsis

Documentation

getCommoditiesAndDateRange :: [Text] -> FilePath -> IO ([CommoditySymbol], Day, Day) Source #

Given a list of Commodities to exclude and a Journal File, return the Commodities in the Journal and the minimum/maximum days from the Journal.

fetchPrices :: Config -> [CommoditySymbol] -> Day -> Day -> Bool -> IO [(CommoditySymbol, [(Day, Prices)])] Source #

Fetch the Prices for the Commodities from the AlphaVantage API, limiting the returned prices between the given Days.

Note: Fetching errors are currently logged to stdout.

rateLimitActions :: [IO a] -> IO [a] Source #

Perform the actions at a rate of 5 per second, then return all the results.

Note: Will log waiting times to stdout.

makePriceDirectives :: [(CommoditySymbol, [(Day, Prices)])] -> ByteString Source #

Build the Price Directives for the Daily Prices of the given Commodities.