https://github.com/torbenconto/plutus
A golang stock data library
https://github.com/torbenconto/plutus
collaborate deepsource jetbrains learn
Last synced: 10 months ago
JSON representation
A golang stock data library
- Host: GitHub
- URL: https://github.com/torbenconto/plutus
- Owner: torbenconto
- License: mit
- Created: 2023-11-30T19:00:38.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-18T22:57:25.000Z (11 months ago)
- Last Synced: 2025-04-05T09:05:14.902Z (10 months ago)
- Topics: collaborate, deepsource, jetbrains, learn
- Language: Go
- Homepage:
- Size: 2.18 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README

## Plutus
*A stock data centered golang library*



[](https://www.codefactor.io/repository/github/torbenconto/plutus)
[](https://app.codacy.com/gh/torbenconto/plutus/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)


### Quick Start
Download the library into your existing golang project
```sh
go get -u github.com/torbenconto/plutus/v2
```
## Basic Usage
```go
import "github.com/torbenconto/plutus/v2"
stock, err := plutus.GetQuote("AMD")
if err != nil {
fmt.Printf("An error occured: %e", err)
}
fmt.Printf("The current price of AMD is: %f", stock.RegularMarketPrice)
```
### Historical Data
```go
import "github.com/torbenconto/plutus/v2"
import _range "github.com/torbenconto/plutus/v2/range"
import "github.com/torbenconto/plutus/v2/interval"
// Create a new historical data object using the ticker of the stock you want data on as well as the range and interval of the data.
stock, err := plutus.GetHistoricalQuote("AMD", _range.FiveDay, interval.OneMin)
if err != nil {
fmt.Printf("An error occured: %e", err)
}
// Returns a list of all the data points as structs containing the time in unix time and the price of the stock at that time.
for _, data := range stock.Data {
fmt.Println(data.Time, data.Open, data.Close, data.High, data.Low, data.Volume)
}
```
### Dividends
```go
import "github.com/torbenconto/plutus/v2"
info, err := plutus.GetDividendInfo("T")
if err != nil {
fmt.Printf("An error occured: %s\n", err)
}
```
# REST api
## The repo containing the api and information about it is contained here [plutus-api](https://github.com/torbenconto/plutus-api)
### Example based documentation
Please use the provided examples to guide you to using plutus to it's full potential.
#### https://github.com/torbenconto/plutus/blob/master/examples
### Tests
To run the tests for the library, simply run the following command in the root of the project.
```sh
go test ./...
```
# Notes
Please only use this module for personal use.
Don't overload my deployment or ill get really sad 🥲.