Skip to content

v1.1.0

Compare
Choose a tag to compare
@d3an d3an released this 14 Jan 00:02
· 8 commits to main since this release
c0a4bfb

Restructured GetQuotes Method

Change to Function Signature

GetQuotes now returns (Results, error). The error here should either be nil or fmt.Errorf("error failed to generate rows from quote KVP map"). If the latter occurs, feel free to raise an issue.

Results is constructed as Results{Data: *dataframe.DataFrame, Warnings: []Warning, Errors: []Error}. As follows:

  • Data is the previously returned DataFrame
  • Warnings is a slice of new Warning structs. An example Warning is given by Warning{Ticker: "INVALID", Error: fmt.Errorf("resource not found")}. Right now, warnings only indicate that Finviz does not support the given ticker.
  • Errors is a slice of new Error structs. An example Error is given by Error{Ticker: "SNAP", Error: fmt.Errorf(...)}. Errors could occur if Finviz has placed you on a block list (usually done via Cloudflare) or could be an internal library error.

If a Warning or Error exists for a Ticker, then the returned DataFrame will not have a row for that Ticker. The three sets, i.e., Data, Warnings, and Errors, are mutually exclusive.

Other Changes

  • Added Exchange column to the returned DataFrame.
  • Fixed a bug that sometimes returned S&P,500 as a stock's Index; now returns S&P500.
  • Added data cleaning to DataFrame results, i.e., most columns should now correspond to their actual data type.
  • Added support for backoff algorithm on request frequency.

Closes #78, #79