|
4 | 4 |
|
5 | 5 | ## Summary |
6 | 6 |
|
7 | | -Welcome to the greatest best new financial data api library implemented in go :sparkles: |
| 7 | +This go package aims to provide a go application with access to current and historical financial markets data in streamlined, well-formatted structures. |
8 | 8 |
|
9 | | -Not production ready! This go package aims to provide a go application with access to financial markets data in streamlined, well-formatted structures. The real benchmark for success will be method signatures that a programmer from any background can understand on sight- put parameters in, get an error-resistant data structure as a result. |
| 9 | +Check out the [qtrn cli application][qtrn], which is intended as a living example of this package. It prints quotes/options info in your favorite command-line in a few keystrokes! |
10 | 10 |
|
11 | | -Accomplishing this goal across several data sources (yfin, morningstar, FRED) etc, while also maximizing code structure flexibility for data source changes in the future is an undertaking that requires some consideration beforehand. So, this README will serve as a planned feature list and development roadmap until a v1 release is stable. Thanks for your patience! |
| 11 | +### Features |
12 | 12 |
|
13 | | -### Planned v1.0 features |
| 13 | +Description | Source |
| 14 | +--- | --- |
| 15 | +Quote(s) | Yahoo finance |
| 16 | +Equity quote(s) | Yahoo finance |
| 17 | +Index quote(s) | Yahoo finance |
| 18 | +Option quote(s) | Yahoo finance |
| 19 | +Forex pair quote(s) | Yahoo finance |
| 20 | +Cryptocurrency pair quote(s) | Yahoo finance |
| 21 | +Futures quote(s) | Yahoo finance |
| 22 | +ETF quote(s) | Yahoo finance |
| 23 | +Mutual fund quote(s) | Yahoo finance |
| 24 | +Historical quotes | Yahoo finance |
| 25 | +Options straddles | Yahoo finance |
14 | 26 |
|
15 | | -Replication of the current features of FlashBoys/go-finance. |
| 27 | +## Documentation |
16 | 28 |
|
17 | | -Status | Description | Source |
18 | | ---- | --- | --- |
19 | | -[x] | Quote(s) | Yahoo finance |
20 | | -[x] | Equity quote(s) | Yahoo finance |
21 | | -[x] | Index quote(s) | Yahoo finance |
22 | | -[x] | Option quote(s) | Yahoo finance |
23 | | -[x] | Forex pair quote(s) | Yahoo finance |
24 | | -[x] | Cryptocurrency pair quote(s) | Yahoo finance |
25 | | -[x] | Futures quote(s) | Yahoo finance |
26 | | -[x] | ETF quote(s) | Yahoo finance |
27 | | -[x] | Mutual fund quote(s) | Yahoo finance |
28 | | -[x] | Historical quotes | Yahoo finance |
29 | | -[x] | Options straddles | Yahoo finance |
30 | | -[ ] | Options chains | Yahoo finance |
31 | | -[ ] | Symbols list | BATS |
| 29 | +A neatly formatted detailed list of implementation instructions and examples will be available on the [piquette website][api-docs]. |
32 | 30 |
|
33 | | -## Planned v1.0 documentation |
34 | | - |
35 | | -A neatly formatted detailed list of implementation instructions and examples will be coming to the [piquette website][api-docs]. |
36 | | - |
37 | | -For details on all the functionality in this library, see the [GoDoc][godoc] documentation. |
| 31 | +For now, for details on all the functionality in this library, see the [GoDoc][godoc] documentation. |
38 | 32 |
|
39 | 33 | ## Installation |
40 | 34 |
|
| 35 | +It is best to use a dependency management tool, but if you want to retrieve it manually, use - |
| 36 | + |
41 | 37 | ```sh |
42 | 38 | go get github.com/piquette/finance-go |
43 | 39 | ``` |
44 | 40 |
|
45 | | -## Usage examples |
| 41 | +## Usage example |
46 | 42 |
|
47 | 43 | Library usage is meant to be very specific about the user's intentions. |
48 | 44 |
|
49 | 45 | ### Quote |
50 | 46 | ```go |
51 | | -quote, err := equity.Get("AAPL") |
| 47 | +q, err := quote.Get("AAPL") |
| 48 | +if err != nil { |
| 49 | + // Uh-oh. |
| 50 | + panic(err) |
| 51 | +} |
| 52 | + |
| 53 | +// Success! |
| 54 | +fmt.Println(q) |
| 55 | +``` |
| 56 | + |
| 57 | +### Equity quote (more fields) |
| 58 | +```go |
| 59 | +q, err := equity.Get("AAPL") |
52 | 60 | if err != nil { |
53 | 61 | // Uh-oh. |
54 | 62 | panic(err) |
55 | 63 | } |
56 | 64 |
|
57 | 65 | // Success! |
58 | | -fmt.Println(quote) |
| 66 | +fmt.Println(q) |
59 | 67 | ``` |
60 | 68 |
|
61 | | -### Historical data |
| 69 | +### Historical quotes (OHLCV) |
62 | 70 | ```go |
63 | | -params := &history.Params{ |
| 71 | +params := &chart.Params{ |
64 | 72 | Symbol: "TWTR", |
65 | | - Interval: history.OneHour, |
| 73 | + Interval: datetime.OneHour, |
66 | 74 | } |
67 | | -chart := history.Get(params) |
| 75 | +iter := chart.Get(params) |
68 | 76 |
|
69 | | -for chart.Next() { |
70 | | - fmt.Println(chart.Bar()) |
| 77 | +for iter.Next() { |
| 78 | + fmt.Println(iter.Bar()) |
71 | 79 | } |
72 | | -if err := chart.Err(); err != nil { |
| 80 | +if err := iter.Err(); err != nil { |
73 | 81 | fmt.Println(err) |
74 | 82 | } |
75 | 83 | ``` |
@@ -126,6 +134,7 @@ pull request][pulls]. Also please email or tweet me as needed. |
126 | 134 |
|
127 | 135 | [godoc]: http://godoc.org/github.com/piquette/finance-go |
128 | 136 | [issues]: https://github.com/piquette/finance-go/issues/new |
| 137 | +[qtrn]: https://github.com/piquette/qtrn |
129 | 138 | [pulls]: https://github.com/piquette/finance-go/pulls |
130 | 139 | [finance-mock]: https://github.com/piquette/finance-mock |
131 | 140 | [stripe]: https://github.com/stripe/stripe-go |
|
0 commit comments