The cl-yahoo-finance Reference Manual

This is the cl-yahoo-finance Reference Manual, version 4.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:34:16 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-yahoo-finance

CL interface to Yahoo’s finance API

Maintainer

Paul Nathan

Author

Paul Nathan

License

LLGPL

Long Description

Common Lisp interface to Yahoo’s finance API, available over the web. See usage.lisp for example code.

Version

4.0

Dependencies
  • drakma (system).
  • babel (system).
  • cl-csv (system).
  • yason (system).
  • url-rewrite (system).
Source

cl-yahoo-finance.asd.

Child Component

cl-yahoo-finance.lisp (file).


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 cl-yahoo-finance/cl-yahoo-finance.asd

Source

cl-yahoo-finance.asd.

Parent Component

cl-yahoo-finance (system).

ASDF Systems

cl-yahoo-finance.


3.1.2 cl-yahoo-finance/cl-yahoo-finance.lisp

Source

cl-yahoo-finance.asd.

Parent Component

cl-yahoo-finance (system).

Packages

cl-yahoo-finance.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cl-yahoo-finance

Source

cl-yahoo-finance.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *proxy*

HTTP proxy: Takes nil, address as string, or list containing address as string and port as integer

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.


5.1.2 Macros

Macro: with-proxy ((proxy-value) &body body)

Binds ‘proxy-value‘ to *proxy* for the duration of the macro

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.


5.1.3 Ordinary functions

Function: read-current-company-info (symbol-list &key proxy)

Reads the current company info and returns it as an a-list

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: read-current-data (symbol-or-symbol-list &key proxy)

Returns a list of hash tables

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: read-current-data-from-csv (symbol-or-symbol-list &key proxy)

Pass in a list of symbols in strings; get a list of a-lists out. Useful if YQL bails on us

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: read-current-options (symbol-list &key proxy)

Takes one or more symbols and returns a list of option hash tables.

See yason-stock-options-parse for details on the data structure.

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: read-historical-data (symbol-string start-date end-date &key historical-type proxy)

Start and end dates are 3-element lists mm/dd/yy Returns a list of hash tables. Keys are: Date Open High Low Close Volume Adj-Close

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: read-historical-splits (symbol-string start-date end-date &key proxy)

Start and end dates are 3-element lists mm/dd/yy Returns a list of hash tables. Keys are: Date Split

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *columns*

This a-list serves as keys for the Yahoo stock information for a given quote

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Special Variable: *debug*

Debugging parameter. Don’t set it unless you’re digging around

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Special Variable: *float-columns*
Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Special Variable: *historical-modes*

Keys into historical quotes

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Special Variable: +string-to-keyword-map+

A-list mapping the strings returned by the YASON into keywords

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.


5.2.2 Ordinary functions

Function: concat-list (seq)

Concatenates a list of strings

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: convert-from-column-strings (dataset)
Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: convert-stringy-table-to-keyword (hash-table)

Returns a new hash table with keywords as the keys instead of strings

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: current-data-cleanse (hash-table)
Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: enquote-string (string)

Surround ‘string‘ with double-quotes, suitable for passing to other systems.

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: getassoc (item alist &key key test)
Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: parse-entry (name string-value)

Convert the STRING-VALUE to a more helpful type.

Returns (values NEW-VALUE converted-p). The second value will be true if a conversion took place.

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: parse-float (string)

Return a float read from string, and the index to the remainder of string.

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: parse-hashtable (table)

Clean and destringify entries in the hash table.

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: read-ratio-to-lisp (str)
Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: request-csv-historical-stock (symbol-string url historical-type start-date end-date)

Core reading function for reading historical data

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: request-yql-info (table symbol-list)

Calls out to the YQL online API to get info on the list of stock symbols

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: request-yql-options-info (symbol-list)
Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: request-yql-quant-info (symbol-list)
Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: request-yql-stock-info (symbol-list)
Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: safely-read-from-string (str &rest read-from-string-args)

Read an expression from the string STR, with *READ-EVAL* set to NIL. Any unsafe expressions will be replaced by NIL in the resulting S-Expression.

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: strcat (&rest strings)
Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: to-s (thing)

Converts ‘thing‘ to a string using FORMAT

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: yason-quant-parse (data-string)

Reads a JSON string assumed to be data from Yahoo.finance.quant and returns a hash-table of its data. "TwoMonthsAgo" is known to map to a HTML string sometimes.

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: yason-stock-options-parse (quote-string)

Reads a string assumed to be Yahoo Finance options tables.

Returns a list of hash tables. Each hash table has keys "symbol" and "option"

symbol points out to the symbol desired;
option points out a a hash table with the following keys

openInt, vol, ask, bid, changeDir, change, lastPrice, strikePrice, type, symbol

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.

Function: yason-stock-quotes-parse (quote-string)

Reads a JSON string assumed to be Yahoo stock information and returns an a-list of its data

Package

cl-yahoo-finance.

Source

cl-yahoo-finance.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   C   E   F   G   M   P   R   S   T   W   Y  
Index Entry  Section

C
concat-list: Private ordinary functions
convert-from-column-strings: Private ordinary functions
convert-stringy-table-to-keyword: Private ordinary functions
current-data-cleanse: Private ordinary functions

E
enquote-string: Private ordinary functions

F
Function, concat-list: Private ordinary functions
Function, convert-from-column-strings: Private ordinary functions
Function, convert-stringy-table-to-keyword: Private ordinary functions
Function, current-data-cleanse: Private ordinary functions
Function, enquote-string: Private ordinary functions
Function, getassoc: Private ordinary functions
Function, parse-entry: Private ordinary functions
Function, parse-float: Private ordinary functions
Function, parse-hashtable: Private ordinary functions
Function, read-current-company-info: Public ordinary functions
Function, read-current-data: Public ordinary functions
Function, read-current-data-from-csv: Public ordinary functions
Function, read-current-options: Public ordinary functions
Function, read-historical-data: Public ordinary functions
Function, read-historical-splits: Public ordinary functions
Function, read-ratio-to-lisp: Private ordinary functions
Function, request-csv-historical-stock: Private ordinary functions
Function, request-yql-info: Private ordinary functions
Function, request-yql-options-info: Private ordinary functions
Function, request-yql-quant-info: Private ordinary functions
Function, request-yql-stock-info: Private ordinary functions
Function, safely-read-from-string: Private ordinary functions
Function, strcat: Private ordinary functions
Function, to-s: Private ordinary functions
Function, yason-quant-parse: Private ordinary functions
Function, yason-stock-options-parse: Private ordinary functions
Function, yason-stock-quotes-parse: Private ordinary functions

G
getassoc: Private ordinary functions

M
Macro, with-proxy: Public macros

P
parse-entry: Private ordinary functions
parse-float: Private ordinary functions
parse-hashtable: Private ordinary functions

R
read-current-company-info: Public ordinary functions
read-current-data: Public ordinary functions
read-current-data-from-csv: Public ordinary functions
read-current-options: Public ordinary functions
read-historical-data: Public ordinary functions
read-historical-splits: Public ordinary functions
read-ratio-to-lisp: Private ordinary functions
request-csv-historical-stock: Private ordinary functions
request-yql-info: Private ordinary functions
request-yql-options-info: Private ordinary functions
request-yql-quant-info: Private ordinary functions
request-yql-stock-info: Private ordinary functions

S
safely-read-from-string: Private ordinary functions
strcat: Private ordinary functions

T
to-s: Private ordinary functions

W
with-proxy: Public macros

Y
yason-quant-parse: Private ordinary functions
yason-stock-options-parse: Private ordinary functions
yason-stock-quotes-parse: Private ordinary functions