hledger-stockquotes: Generate HLedger Price Directives From Daily Stock Quotes.

[ bsd3, console, finance, library, program ] [ Propose Tags ]

hledger-stockquotes is an addon for hledger that reads your journal file, pulls the historical stock prices for commodities, and writes out a new journal file containing the respective price directives.

The AlphaVantage API is used to fetch the stock quotes and you will need a free API key to use this program.

You can install hledger-stockquotes with Stack: stack install --resolver nightly hledger-stockquotes. Then run hledger-stockquotes --help to see the usage instructions & all available options.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.2.1
Change log CHANGELOG.md
Dependencies aeson (>=1 && <2), base (>=4.7 && <5), bytestring (<1), cmdargs (>=0.6 && <1), containers (<1), hledger-lib (<2), hledger-stockquotes, req (>=3 && <4), safe (>=0.3.5 && <1), scientific (<1), split (<1), text (<2), time (<2), unordered-containers (<0.3) [details]
License BSD-3-Clause
Copyright 2020 Pavan Rikhi
Author Pavan Rikhi
Maintainer pavan.rikhi@gmail.com
Category Finance, Console
Home page https://github.com/prikhi/hledger-stockquotes#readme
Bug tracker https://github.com/prikhi/hledger-stockquotes/issues
Source repo head: git clone https://github.com/prikhi/hledger-stockquotes
Uploaded by lysergia at 2020-03-19T15:09:30Z
Distributions LTSHaskell:0.1.2.1, NixOS:0.1.2.1
Executables hledger-stockquotes
Downloads 878 total (16 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-03-19 [all 1 reports]

Readme for hledger-stockquotes-0.1.0.0

[back to package description]

hledger-stockquotes

hledger-stockquotes Build Status

hledger-stockquotes is a CLI addon for hledger that reads a journal file and pulls the historical prices for commodities from AlphaVantage. To use this application, you'll need a free AlphaVantage API key.

Running

This application is still in early development, so you'll need to clone this repository first:

git clone https://github.com/prikhi/hledger-stockquotes.git
cd hledger-stockquotes

Then you can run the application:

stack run -- --help

Use the -a flag to pass in your API key and optionally pass the path to your journal file:

stack run -- -a API_KEY -f accounting.journal

If you omit the -f flag, the journal file will fallback to the value of the LEDGER_FILE environmental variable. If LEDGER_FILE is undefined, a fallback of ~/.hledger.journal will be used.

You can omit the -a flag by setting the ALPHAVANTAGE_KEY environmental variable.

The output file defaults to prices.journal. You can customize this with the -o flag. Note that the contents of the output file will be overwritten if the file already exists.

By default, the application will limit itself to 5 API requests a minute, as specified by the AlphaVantage documentation. You can override this by using the -n flag. You can have the application print the dates and commodities it will fetch by passing the --dry-run flag.

Manual Builds

You can build the project with stack: stack build

For development, you can enable fast builds with file-watching, documentation-building, & test-running: stack test --haddock --fast --file-watch

To build & open the documentation, run stack haddock --open hledger-stockquotes

To install the executable to ~/.local/bin, run stack install.

LICENSE

BSD-3