stock_quote 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/LICENSE +19 -0
- data/README.md +137 -0
- data/stock_quote.gemspec +31 -0
- metadata +151 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ffeac1e0c2cf1de988b8bf0368a1c6fa947407942a4fdcfd6de6335391e9fe1d
|
4
|
+
data.tar.gz: db655e848d6d946d72a0338a8cb8ca186546daec3eeeb49599402fac3d8774e0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 02e088454e4f5bcc27d4b35a36cc57da04f8c4371f84b2c746e1ee12bd6370cda4e2d56b2f45445279885a625735b2ba6aec2dbadc1e30746428f8297ff377b3
|
7
|
+
data.tar.gz: 70f28d6bcd63248965d6d9111d7f678b0a4c934ad84d4e0911009e3f65f561f6576de88e8c6ea646c64acc7d9bdd9cc8800593b15426796f6b39ec6279d3f146
|
data/.gitignore
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
StockQuote
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.7.2
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2017 Ty Rauber
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
# stock_quote
|
2
|
+
|
3
|
+
Real-time, stock data and historical pricing. Data provided by [IEXCLOUD.IO](https://iexcloud.io/). An [API KEY](https://iexcloud.io/cloud-login#/register/) is now required.
|
4
|
+
|
5
|
+
# Update
|
6
|
+
|
7
|
+
On August 29, 2023, it was reported that ["IEX Cloud Has Changed their Pricing Structure" (#70)](/../../issues/70), and will no longer be allowing free API access. Additionally, the API endpoint this library currently uses will now cost $1500/month to access. Please be aware of [the pricing changes](https://iexcloud.io/pricing) and direct all related inquires to [IEX support](https://iexcloud.io/console/support).
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
To install the 'stock_quote' ruby gem:
|
12
|
+
|
13
|
+
`gem install stock_quote`
|
14
|
+
|
15
|
+
## Gem Configuration
|
16
|
+
|
17
|
+
To use the gem in your Rails Application, include it in your Gemfile:
|
18
|
+
|
19
|
+
`gem "stock_quote"`, '~> 3.0.0'
|
20
|
+
|
21
|
+
|
22
|
+
## Initialization
|
23
|
+
|
24
|
+
To globally initialize StockQuote with a valid API_KEY:
|
25
|
+
|
26
|
+
`StockQuote::Stock.new(api_key: YOUR_API_KEY)`
|
27
|
+
|
28
|
+
You can also supply api_key as an attribute in any StockQuote::Stock method.
|
29
|
+
|
30
|
+
### StockQuote::Stock.quote(symbol)
|
31
|
+
|
32
|
+
Quote is the primary method, returning a StockQuote::Stock instance, including the following attributes (new in v2.0.0).
|
33
|
+
|
34
|
+
`symbol, company_name, primary_exchange, sector, calculation_price, open, open_time, close, close_time, high, low, latest_price, latest_source, latest_time, latest_update, latest_volume, iex_realtime_price, iex_realtime_size, iex_last_updated, delayed_price, delayed_price_time, previous_close, change, change_percent, iex_market_percent, iex_volume, avg_total_volume, iex_bid_price, iex_bid_size, iex_ask_price, iex_ask_size, market_cap, pe_ratio, week52_high, week52_low, ytd_change, chart`
|
35
|
+
|
36
|
+
You can get a current quote with the following syntax:
|
37
|
+
|
38
|
+
`stock = StockQuote::Stock.quote("symbol")`
|
39
|
+
|
40
|
+
Where symbol equals the company stock symbol you want a quote for. For example, "aapl" for Apple, Inc.
|
41
|
+
|
42
|
+
You may search for multiple stocks by separating symbols with a comma (or array). For example:
|
43
|
+
|
44
|
+
`stocks = StockQuote::Stock.quote("aapl,tsla")`
|
45
|
+
|
46
|
+
These queries will return a Stock object or an array of Stock objects which you may iterate through.
|
47
|
+
|
48
|
+
Note: You can receive a raw json hash response with the following syntax:
|
49
|
+
|
50
|
+
`stocks = StockQuote::Stock.raw_quote("aapl,tsla")`
|
51
|
+
|
52
|
+
The raw_ method is available on all supported methods.
|
53
|
+
|
54
|
+
### Other Methods
|
55
|
+
|
56
|
+
The IEX API is quite extensive and well documented.
|
57
|
+
|
58
|
+
V3.0.0 of stock_quote mirrors the IEXCLOUD.IO API:
|
59
|
+
|
60
|
+
* [book](https://iexcloud.io/docs/api/#book)
|
61
|
+
* [chart](https://iexcloud.io/docs/api/#historical-prices)
|
62
|
+
* [company](https://iexcloud.io/docs/api/#company)
|
63
|
+
* [delayed_quote](https://iexcloud.io/docs/api/#delayed-quote)
|
64
|
+
* [dividends](https://iexcloud.io/docs/api/#dividends)
|
65
|
+
* [earnings](https://iexcloud.io/docs/api/#earnings)
|
66
|
+
* [financials](https://iexcloud.io/docs/api/#financials)
|
67
|
+
* [stats](https://iexcloud.io/docs/api/#key-stats)
|
68
|
+
* [logo](https://iexcloud.io/docs/api/#logo)
|
69
|
+
* [news](https://iexcloud.io/docs/api/#news)
|
70
|
+
* [ohlc](https://iexcloud.io/docs/api/#ohlc)
|
71
|
+
* [peers](https://iexcloud.io/docs/api/#peers)
|
72
|
+
* [previous](https://iexcloud.io/docs/api/#previous)
|
73
|
+
* [price](https://iexcloud.io/docs/api/#price)
|
74
|
+
* [quote](https://iexcloud.io/docs/api/#quote)
|
75
|
+
* [relevant](https://iexcloud.io/docs/api/#relevant)
|
76
|
+
* [splits](https://iexcloud.io/docs/api/#splits)
|
77
|
+
* [volume_by_venue](https://iexcloud.io/docs/api/#volume-by-venue)
|
78
|
+
|
79
|
+
All these methods are available on StockQuote::Stock.
|
80
|
+
|
81
|
+
For example:
|
82
|
+
|
83
|
+
```StockQuote::Stock.company('aapl')```
|
84
|
+
|
85
|
+
Retrieves company information.
|
86
|
+
|
87
|
+
For example:
|
88
|
+
|
89
|
+
```StockQuote::Stock.dividends('aapl')```
|
90
|
+
|
91
|
+
Retrieves dividend information.
|
92
|
+
|
93
|
+
Raw json hash responses are available for any of the methods by pre-fixing the method name with "raw__".
|
94
|
+
|
95
|
+
For example:
|
96
|
+
|
97
|
+
```StockQuote::Stock.raw_dividends('aapl')```
|
98
|
+
|
99
|
+
Retrieves raw dividend information.
|
100
|
+
|
101
|
+
### [batch](https://iextrading.com/developer/docs/#batch-requests)
|
102
|
+
|
103
|
+
Batch allows you to batch requests. All methods in stock_quote use batch under-the-hood.
|
104
|
+
|
105
|
+
Batch follows the syntax:
|
106
|
+
|
107
|
+
```StockQuote::Stock.batch(type, symbol, range)```
|
108
|
+
|
109
|
+
Where type can be multiple of the above methods and symbol can be an array of company symbols.
|
110
|
+
|
111
|
+
Range can be:
|
112
|
+
|
113
|
+
`5y, 2y, 1y, ytd, 6m, 3m, 1m, 1d`
|
114
|
+
|
115
|
+
And are applied to chart method.
|
116
|
+
|
117
|
+
## License
|
118
|
+
|
119
|
+
Copyright (c) 2019 Ty Rauber
|
120
|
+
|
121
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
122
|
+
of this software and associated documentation files (the "Software"), to deal
|
123
|
+
in the Software without restriction, including without limitation the rights
|
124
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
125
|
+
copies of the Software, and to permit persons to whom the Software is
|
126
|
+
furnished to do so, subject to the following conditions:
|
127
|
+
|
128
|
+
The above copyright notice and this permission notice shall be included in
|
129
|
+
all copies or substantial portions of the Software.
|
130
|
+
|
131
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
132
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
133
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
134
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
135
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
136
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
137
|
+
THE SOFTWARE.
|
data/stock_quote.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
3
|
+
#require 'stock_quote/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'stock_quote'
|
7
|
+
s.version = '4.0.0'
|
8
|
+
s.authors = ['Ty Rauber']
|
9
|
+
s.email = ['tyrauber@mac.com']
|
10
|
+
s.homepage = 'https://github.com/tyrauber/stock_quote'
|
11
|
+
s.summary = 'DEPRECATED: A ruby gem that retrieves real-time stock quotes from IEX.'
|
12
|
+
s.description = 'Retrieve book, chart, company, delayed quote, dividends, earnings, effective spread, financials, stats, lists, logo, news, OHLC, open/close, peers, previous, price, quote, relevant, splits, timeseries, volume by venue and batch requests through IEX (iextrading.com/developer)'
|
13
|
+
s.rubyforge_project = 'stock_quote'
|
14
|
+
s.license = 'MIT'
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
19
|
+
s.require_paths = ['lib']
|
20
|
+
|
21
|
+
# specify any dependencies here; for example:
|
22
|
+
|
23
|
+
s.add_development_dependency 'bundler', '~> 2.0.1'
|
24
|
+
s.add_development_dependency 'rake'
|
25
|
+
s.add_development_dependency 'rspec', '~> 3.8.0'
|
26
|
+
s.add_development_dependency 'vcr', '~> 4.0.0'
|
27
|
+
s.add_development_dependency 'webmock', '~> 3.4.2'
|
28
|
+
s.add_runtime_dependency 'rest-client', '~> 2.0.2'
|
29
|
+
s.add_runtime_dependency 'json'
|
30
|
+
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: stock_quote
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 4.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ty Rauber
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-01-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.1
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.8.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.8.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: vcr
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 4.0.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 4.0.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 3.4.2
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 3.4.2
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rest-client
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.0.2
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.0.2
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: json
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: Retrieve book, chart, company, delayed quote, dividends, earnings, effective
|
112
|
+
spread, financials, stats, lists, logo, news, OHLC, open/close, peers, previous,
|
113
|
+
price, quote, relevant, splits, timeseries, volume by venue and batch requests through
|
114
|
+
IEX (iextrading.com/developer)
|
115
|
+
email:
|
116
|
+
- tyrauber@mac.com
|
117
|
+
executables: []
|
118
|
+
extensions: []
|
119
|
+
extra_rdoc_files: []
|
120
|
+
files:
|
121
|
+
- ".gitignore"
|
122
|
+
- ".ruby-gemset"
|
123
|
+
- ".ruby-version"
|
124
|
+
- Gemfile
|
125
|
+
- LICENSE
|
126
|
+
- README.md
|
127
|
+
- stock_quote.gemspec
|
128
|
+
homepage: https://github.com/tyrauber/stock_quote
|
129
|
+
licenses:
|
130
|
+
- MIT
|
131
|
+
metadata: {}
|
132
|
+
post_install_message:
|
133
|
+
rdoc_options: []
|
134
|
+
require_paths:
|
135
|
+
- lib
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubygems_version: 3.1.4
|
148
|
+
signing_key:
|
149
|
+
specification_version: 4
|
150
|
+
summary: 'DEPRECATED: A ruby gem that retrieves real-time stock quotes from IEX.'
|
151
|
+
test_files: []
|