Skip to content

Commit d49b8d7

Browse files
authored
Merge pull request #15 from ggoodwin/develop
v1.0.1
2 parents c3d929e + 96c1d44 commit d49b8d7

File tree

7 files changed

+227
-8
lines changed

7 files changed

+227
-8
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
88

99
- Will list future updates here
1010

11+
## [1.0.2] - 2023-05-24
12+
13+
### Added
14+
15+
- Added `docs` folder.
16+
- Added `img` folder to `docs` folder.
17+
- Added `src` folder.
18+
- Added `GettingStarted.md` to `docs` folder.
19+
- Added `index.md` to `docs` folder.
20+
- Added `examples` folder.
21+
22+
### Updated
23+
24+
- Updated `CHANGELOG.md` to reflect changes.
25+
- Updated `README.md` to reflect changes.
26+
- Moved `consts.go` to `src` folder.
27+
- Moved `structs.go` to `src` folder.
28+
- Moved and renamed `go-nyse-stocks.go` to `src` folder.
29+
1130
## [1.0.1] - 2023-05-23
1231

1332
### Updated
@@ -89,7 +108,8 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
89108
[Semantic Versioning]: https://semver.org/
90109

91110
<!-- Versions -->
92-
[unreleased]: https://github.com/ggoodwin/go-nyse-stocks/compare/v1.0.1...DEVELOP
111+
[unreleased]: https://github.com/ggoodwin/go-nyse-stocks/compare/v1.0.2...DEVELOP
112+
[1.0.2]: https://github.com/ggoodwin/go-nyse-stocks/compare/v1.0.1...v1.0.2
93113
[1.0.1]: https://github.com/ggoodwin/go-nyse-stocks/compare/v1.0.0...v1.0.1
94114
[1.0.0]: https://github.com/ggoodwin/go-nyse-stocks/compare/v0.0.6...v1.0.0
95115
[0.0.6]: https://github.com/ggoodwin/go-nyse-stocks/compare/v0.0.5...v0.0.6

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
New York Stock Exchange (NYSE) Go Library
44
</h1>
55

6-
[![Go Reference](https://pkg.go.dev/badge/ggoodwin/go-nyse-stocks.svg)](https://pkg.go.dev/github.com/ggoodwin/go-nyse-stocks) [![Go Version](https://img.shields.io/github/go-mod/go-version/ggoodwin/go-nyse-stocks)](https://go.dev/) [![GoReportCard](https://goreportcard.com/badge/github.com/ggoodwin/go-nyse-stocks)](https://goreportcard.com/report/github.com/ggoodwin/go-nyse-stocks) [![CodeFactor](https://www.codefactor.io/repository/github/ggoodwin/go-nyse-stocks/badge)](https://www.codefactor.io/repository/github/ggoodwin/go-nyse-stocks) [![Build](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/build.yml/badge.svg)](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/build.yml) [![lint](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/lint.yml/badge.svg)](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/lint.yml) [![CodeQL](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/github-code-scanning/codeql) ![Size](https://img.shields.io/github/languages/code-size/ggoodwin/go-nyse-stocks) [![Last Commit](https://img.shields.io/github/last-commit/ggoodwin/go-nyse-stocks)](https://github.com/ggoodwin/go-nyse-stocks/commits/master) [![License](https://img.shields.io/github/license/ggoodwin/go-nyse-stocks)](https://github.com/ggoodwin/go-nyse-stocks/blob/master/LICENSE.md)
6+
![Discord](https://img.shields.io/discord/1110957574846693416) [![Go Reference](https://pkg.go.dev/badge/ggoodwin/go-nyse-stocks.svg)](https://pkg.go.dev/github.com/ggoodwin/go-nyse-stocks) [![Go Version](https://img.shields.io/github/go-mod/go-version/ggoodwin/go-nyse-stocks)](https://go.dev/) [![GoReportCard](https://goreportcard.com/badge/github.com/ggoodwin/go-nyse-stocks)](https://goreportcard.com/report/github.com/ggoodwin/go-nyse-stocks) [![CodeFactor](https://www.codefactor.io/repository/github/ggoodwin/go-nyse-stocks/badge)](https://www.codefactor.io/repository/github/ggoodwin/go-nyse-stocks) [![Build](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/build.yml/badge.svg)](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/build.yml) [![lint](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/lint.yml/badge.svg)](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/lint.yml) [![CodeQL](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/ggoodwin/go-nyse-stocks/actions/workflows/github-code-scanning/codeql) ![Size](https://img.shields.io/github/languages/code-size/ggoodwin/go-nyse-stocks) [![Last Commit](https://img.shields.io/github/last-commit/ggoodwin/go-nyse-stocks)](https://github.com/ggoodwin/go-nyse-stocks/commits/master) [![License](https://img.shields.io/github/license/ggoodwin/go-nyse-stocks)](https://github.com/ggoodwin/go-nyse-stocks/blob/master/LICENSE.md)
77

88
</div>
99
<hr/>
@@ -39,7 +39,7 @@ go get github.com/ggoodwin/go-nyse-stocks
3939
Add the import to your `.go` file
4040

4141
```go
42-
import nyse_stocks "github.com/ggoodwin/go-nyse-stocks"
42+
import "github.com/ggoodwin/go-nyse-stocks"
4343
```
4444

4545
## 💰 Usage
@@ -51,15 +51,15 @@ Add this to your `.go` file
5151
```go
5252
// Parameter: Stock Symbol
5353
// Returns: strings ex: `$123.45`, `1.23%`, `↑`
54-
price, percent, direction := nyse_stocks.GetPriceAndPercentage("AAPL")
54+
price, percent, direction := go_nyse_stocks.GetPriceAndPercentage("AAPL")
5555
```
5656

5757
### Get full stock details
5858

5959
```go
6060
// Parameter: Stock Symbol
6161
// Returns `Result` struct
62-
stock := nyse_stocks.GetFullDetails("AAPL")
62+
stock := go_nyse_stocks.GetFullDetails("AAPL")
6363
```
6464

6565
### Result struct

docs/GettingStarted.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Getting Started
2+
3+
This page is dedicated to helping you get started with go-nyse-stocks.
4+
Once you've done that please don't forget to submit it to the
5+
[Awesome go-nyse-stocks] list :).
6+
7+
**First, lets cover a few topics so you can make the best choices on how to
8+
move forward from here.**
9+
10+
## Requirements
11+
12+
go-nyse-stocks requires Go version 1.19 or higher. It has been tested to compile and
13+
run successfully on Debian Linux 8, FreeBSD 10, and Windows 7. It is expected
14+
that it should work anywhere Go 1.19 or higher works. If you run into problems
15+
please let me know :).
16+
17+
You must already have a working Go environment setup to use go-nyse-stocks. If you
18+
are new to Go and have not yet installed and tested it on your computer then
19+
please visit the [Go Install Page] first then I highly
20+
recommend you walk though [A Tour of Go] to
21+
help get your familiar with the Go language. Also checkout the relevant Go plugin
22+
for your editor &mdash; they are hugely helpful when developing Go code.
23+
24+
* Visual Studio &mdash; [vscode-go]
25+
* Vim &mdash; [vim-go]
26+
* Sublime &mdash; [GoSublime]
27+
28+
## Install go-nyse-stocks
29+
30+
Like any other Go package the fist step is to `go get` the package. This will
31+
always pull the latest tagged release from the master branch. Then run
32+
`go install` to compile and install the libraries on your system.
33+
34+
### Windows
35+
36+
Simply run the following command in a command prompt or powershell instance to download, compile, and install the package.
37+
38+
Make sure you are in your project's directory before running the command.
39+
40+
```plain
41+
go get github.com/ggoodwin/go-nyse-stocks
42+
```
43+
44+
### Linux/BSD/MacOS
45+
46+
Run go get to download the package to your GOPATH/src folder.
47+
48+
```sh
49+
go get github.com/ggoodwin/go-nyse-stocks
50+
```
51+
52+
Finally, compile and install the package into the GOPATH/pkg folder. This isn't
53+
absolutely required but doing this will allow the Go plugin for your editor to
54+
provide autocomplete for all go-nyse-stocks functions.
55+
56+
```sh
57+
cd $GOPATH/src/github.com/ggoodwin/go-nyse-stocks
58+
go install
59+
```
60+
61+
## Use go-nyse-stocks
62+
63+
### Importing
64+
65+
Add the import to your `.go` file
66+
67+
```go
68+
import "github.com/ggoodwin/go-nyse-stocks"
69+
```
70+
71+
### Commands
72+
73+
#### Stock Price and Percentage Change
74+
75+
Add this to your `.go` file
76+
77+
```go
78+
// Parameter: Stock Symbol
79+
// Returns: strings ex: `$123.45`, `1.23%`, `↑`
80+
price, percent, direction := go_nyse_stocks.GetPriceAndPercentage("AAPL")
81+
```
82+
83+
#### Get full stock details
84+
85+
```go
86+
// Parameter: Stock Symbol
87+
// Returns `Result` struct
88+
stock := go_nyse_stocks.GetFullDetails("AAPL")
89+
```
90+
91+
### Result struct
92+
93+
```go
94+
type Result struct {
95+
Symbol string `json:"symbol"`
96+
ShortName string `json:"shortName"`
97+
QuoteSourceName string `json:"quoteSourceName"`
98+
Language string `json:"language"`
99+
Region string `json:"region"`
100+
QuoteType string `json:"quoteType"`
101+
Triggerable bool `json:"triggerable"`
102+
Currency string `json:"currency"`
103+
Exchange string `json:"exchange"`
104+
MessageBoardID string `json:"messageBoardId"`
105+
ExchangeTimezoneName string `json:"exchangeTimezoneName"`
106+
ExchangeTimezoneShortName string `json:"exchangeTimezoneShortName"`
107+
GmtOffSetMilliseconds int `json:"gmtOffSetMilliseconds"`
108+
Market string `json:"market"`
109+
EsgPopulated bool `json:"esgPopulated"`
110+
FirstTradeDateMilliseconds int64 `json:"firstTradeDateMilliseconds"`
111+
RegularMarketChange float64 `json:"regularMarketChange"`
112+
RegularMarketChangePercent float64 `json:"regularMarketChangePercent"`
113+
RegularMarketTime int `json:"regularMarketTime"`
114+
RegularMarketPrice float64 `json:"regularMarketPrice"`
115+
RegularMarketDayHigh float64 `json:"regularMarketDayHigh"`
116+
RegularMarketDayRange string `json:"regularMarketDayRange"`
117+
RegularMarketDayLow float64 `json:"regularMarketDayLow"`
118+
RegularMarketVolume int64 `json:"regularMarketVolume"`
119+
RegularMarketPreviousClose float64 `json:"regularMarketPreviousClose"`
120+
FullExchangeName string `json:"fullExchangeName"`
121+
RegularMarketOpen float64 `json:"regularMarketOpen"`
122+
AverageDailyVolume3Month int64 `json:"averageDailyVolume3Month"`
123+
AverageDailyVolume10Day int64 `json:"averageDailyVolume10Day"`
124+
StartDate int `json:"startDate"`
125+
CoinImageURL string `json:"coinImageUrl"`
126+
FiftyTwoWeekLowChange float64 `json:"fiftyTwoWeekLowChange"`
127+
FiftyTwoWeekLowChangePercent float64 `json:"fiftyTwoWeekLowChangePercent"`
128+
FiftyTwoWeekRange string `json:"fiftyTwoWeekRange"`
129+
FiftyTwoWeekHighChange float64 `json:"fiftyTwoWeekHighChange"`
130+
FiftyTwoWeekHighChangePercent float64 `json:"fiftyTwoWeekHighChangePercent"`
131+
FiftyTwoWeekLow float64 `json:"fiftyTwoWeekLow"`
132+
FiftyTwoWeekHigh float64 `json:"fiftyTwoWeekHigh"`
133+
FiftyDayAverage float64 `json:"fiftyDayAverage"`
134+
FiftyDayAverageChange float64 `json:"fiftyDayAverageChange"`
135+
FiftyDayAverageChangePercent float64 `json:"fiftyDayAverageChangePercent"`
136+
TwoHundredDayAverage float64 `json:"twoHundredDayAverage"`
137+
TwoHundredDayAverageChange float64 `json:"twoHundredDayAverageChange"`
138+
TwoHundredDayAverageChangePercent float64 `json:"twoHundredDayAverageChangePercent"`
139+
MarketCap int64 `json:"marketCap"`
140+
SourceInterval int `json:"sourceInterval"`
141+
ExchangeDataDelayedBy int `json:"exchangeDataDelayedBy"`
142+
Tradeable bool `json:"tradeable"`
143+
MarketState string `json:"marketState"`
144+
}
145+
```
146+
147+
<!-- Links -->
148+
[Awesome go-nyse-stocks]: https://github.com/ggoodwin/go-nyse-stocks/wiki/Awesome-go-nyse-stocks
149+
[Go Install Page]: https://golang.org/doc/install
150+
[A Tour of Go]: https://tour.golang.org/welcome/1
151+
[vim-go]: https://github.com/fatih/vim-go
152+
[GoSublime]: https://github.com/DisposaBoy/GoSublime
153+
[vscode-go]: https://github.com/golang/vscode-go

docs/index.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## DiscordGo
2+
3+
<hr>
4+
<h1>
5+
<img align="right" src="https://github.com/ggoodwin/go-nyse-stocks/blob/master/stock.png" height="300">
6+
<br/>
7+
New York Stock Exchange (NYSE) Go Library
8+
</h1>
9+
10+
[Go] (Golang) package for [New York Stock Exchange] stock prices.
11+
`GetPriceAndPercentage` provides both the current price and percentage change since the previous open, positive or negative.
12+
It also includes an advanced `GetFullDetails` call, which returns a struct with all available details.
13+
14+
### Why go-nyse-stocks?
15+
16+
* High Performance
17+
* Minimal Memory & CPU Load
18+
* Accurate and Reliable
19+
20+
### Learn More
21+
22+
* Check out the [Getting Started] section
23+
* Visit the [Gitbook] site.
24+
* Read the reference docs on [Godoc]
25+
* Try the [Examples]
26+
* Explore [Awesome go-nyse-stocks]
27+
28+
### Join Us
29+
30+
Both of the below links take you to chat channels where you can get more
31+
information and support for DiscordGo. There's also a chance to make some
32+
friends :).
33+
34+
* Join the [Discord Gophers] chat server dedicated to Go programming.
35+
* Join the [Discord Go Package Devs] chat server dedicated to Go Package Development.
36+
37+
<!-- Links -->
38+
[GO]: https://golang.org/
39+
[New York Stock Exchange]: https://www.nyse.com/index
40+
[Getting Started]: GettingStarted.md
41+
[Godoc]: https://godoc.org/github.com/ggoodwin/go-nyse-stocks
42+
[Gitbook]: https://docs.greg.id/go-nyse-stocks
43+
[Examples]: https://github.com/ggoodwin/go-nyse-stocks/tree/master/examples
44+
[Awesome go-nyse-stocks]: https://github.com/ggoodwin/go-nyse-stocks/wiki/Awesome-go-nyse-stocks
45+
[Discord Gophers]: https://discord.gg/0f1SbxBZjYoCtNPP
46+
[Discord Go Package Devs]: https://discord.gg/qYRZEF43Ab

consts.go renamed to src/consts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package nyse_stocks
1+
package go_nyse_stocks
22

33
/**SECTION - Constants
44
* * This section contains all the constants used in the program

queries.go renamed to src/go-nyse-stocks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package nyse_stocks
1+
package go_nyse_stocks
22

33
import (
44
"encoding/json"

structs.go renamed to src/structs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package nyse_stocks
1+
package go_nyse_stocks
22

33
/**SECTION - Structs
44
* * This section contains all the structs used in the program

0 commit comments

Comments
 (0)