eodhd.rb 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +94 -0
- data/README.md +86 -14
- data/Rakefile +28 -0
- data/eodhd.rb.gemspec +31 -13
- data/lib/Eodhd/Client.rb +7 -0
- data/lib/Eodhd/EodBulkLastDay.rb +2 -0
- data/lib/Eodhd/EodData.rb +2 -0
- data/lib/Eodhd/Exchange.rb +2 -0
- data/lib/Eodhd/ExchangeSymbol.rb +2 -0
- data/lib/Eodhd/Fundamentals/AnalystRatings.rb +29 -0
- data/lib/Eodhd/Fundamentals/ESGScores.rb +37 -0
- data/lib/Eodhd/Fundamentals/Earnings.rb +21 -0
- data/lib/Eodhd/Fundamentals/Financials/Statement.rb +21 -0
- data/lib/Eodhd/Fundamentals/Financials.rb +23 -0
- data/lib/Eodhd/Fundamentals/General.rb +85 -0
- data/lib/Eodhd/Fundamentals/Highlights.rb +63 -0
- data/lib/Eodhd/Fundamentals/Holders.rb +19 -0
- data/lib/Eodhd/Fundamentals/SharesStats.rb +33 -0
- data/lib/Eodhd/Fundamentals/SplitsDividends.rb +31 -0
- data/lib/Eodhd/Fundamentals/Technicals.rb +33 -0
- data/lib/Eodhd/Fundamentals/Valuation.rb +29 -0
- data/lib/Eodhd/Fundamentals.rb +85 -0
- data/lib/Eodhd/VERSION.rb +1 -1
- data/lib/{Eodhd.rb → eodhd.rb} +27 -17
- data/test/{client_test.rb → Eodhd/Client_test.rb} +38 -14
- data/test/Eodhd/Fundamentals_test.rb +78 -0
- data/test/{validations_test.rb → Eodhd/Validations_test.rb} +4 -2
- data/test/{web_socket_client_test.rb → Eodhd/WebSocketClient_test.rb} +9 -7
- data/test/{eodhd_test.rb → Eodhd_test.rb} +12 -1
- data/test/helper.rb +3 -0
- metadata +40 -11
- data/test/test_all.rb +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c1069704c5c33b2d2f8ac727042cd018a4e85f350a5db906c23ab6de340c843
|
|
4
|
+
data.tar.gz: ee3d1a440f09a268c526f0304f40f2ee8df2cf8db9f7c6cf1e6301795a27d0c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50d5ac80991db837750c9f1995053f249b4da0ca929e388210a7c0ed820e693c3d369764fd335f89c9fa7915d472a05e9635af817676c277ef8727941e9f6eef
|
|
7
|
+
data.tar.gz: 84f008668a65ecd3537c5b282d7cfbde8faf59937897130fa0d000fc6c2535cfd6d05c21c32d0a3f14e871aef585713df28914c1d9bb9743bc668d628526276b
|
data/CHANGELOG
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# eodhd.rb/CHANGELOG
|
|
2
|
+
|
|
3
|
+
## [0.18.0] - 2026-03-20, + fundamentals endpoint
|
|
4
|
+
- + Eodhd::Fundamentals: Model for fundamental data with typed sub-objects.
|
|
5
|
+
- + Eodhd::Fundamentals::General
|
|
6
|
+
- + Eodhd::Fundamentals::Highlights
|
|
7
|
+
- + Eodhd::Fundamentals::Valuation
|
|
8
|
+
- + Eodhd::Fundamentals::SharesStats
|
|
9
|
+
- + Eodhd::Fundamentals::Technicals
|
|
10
|
+
- + Eodhd::Fundamentals::SplitsDividends
|
|
11
|
+
- + Eodhd::Fundamentals::AnalystRatings
|
|
12
|
+
- + Eodhd::Fundamentals::Holders
|
|
13
|
+
- + Eodhd::Fundamentals::ESGScores
|
|
14
|
+
- + Eodhd::Fundamentals::Earnings
|
|
15
|
+
- + Eodhd::Fundamentals::Financials
|
|
16
|
+
- + Eodhd::Fundamentals::Financials::Statement
|
|
17
|
+
- + Eodhd::Client#fundamentals: Fetch fundamental data for a symbol.
|
|
18
|
+
- + Eodhd#fundamentals: Facade method for fundamental data.
|
|
19
|
+
- + test/Eodhd/Fundamentals_test.rb
|
|
20
|
+
- ~ test/Eodhd/Client_test.rb: + tests for fundamentals endpoint.
|
|
21
|
+
- ~ test/Eodhd_test.rb: + test for fundamentals facade method.
|
|
22
|
+
- ~ test/helper.rb: + require 'minitest/mock' for minitest 6 compatibility.
|
|
23
|
+
- ~ Eodhd: Move initialize, web_socket, stream to private.
|
|
24
|
+
- ~ Eodhd: + safe navigation (&.) on exchange and exchange_symbol across all methods.
|
|
25
|
+
- ~ Eodhd#intraday: + exchange_symbol argument.
|
|
26
|
+
- ~ Eodhd#intraday: - default exchange_code of 'US'
|
|
27
|
+
- ~ test/: Reorganise test files into test/Eodhd/ subdirectory.
|
|
28
|
+
- - test/test_all.rb: Previously replaced by Rakefile.
|
|
29
|
+
- /CHANGELOG.txt/CHANGELOG/
|
|
30
|
+
- + LICENSE: MIT License.
|
|
31
|
+
- ~ README.md: Rewrite with intraday, fundamentals, and WebSocket documentation.
|
|
32
|
+
|
|
33
|
+
## [0.17.0] - 2025-10-05, + intraday endpoint
|
|
34
|
+
- + Eodhd::Intraday: Model for intraday data.
|
|
35
|
+
- + Eodhd::Client#intraday: Fetch intraday data for US stocks.
|
|
36
|
+
- + Eodhd#intraday: Facade method for intraday data.
|
|
37
|
+
- + Eodhd::Validations#validate_interval: Validation of intraday intervals (1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w, 1mo).
|
|
38
|
+
- ~ Eodhd::Validations#validate_arguments: + interval argument.
|
|
39
|
+
- ~ test/validations_test.rb: + tests for validate_interval.
|
|
40
|
+
- ~ test/client_test.rb: + tests for intraday endpoint.
|
|
41
|
+
- ~ test/eodhd_test.rb: + tests for intraday facade method.
|
|
42
|
+
|
|
43
|
+
## [0.16.0] - 2025-10-05, + automated tests, + DefaultLogger, fix WebSocket bugs, improve validations
|
|
44
|
+
- + Eodhd::DefaultLogger: A shared logger for Client and WebSocketClient.
|
|
45
|
+
- ~ Eodhd::Client: Use DefaultLogger.
|
|
46
|
+
- ~ Eodhd::Client#initialize: + logger, use_default_logger arguments.
|
|
47
|
+
- + Eodhd::Client#use_logging?
|
|
48
|
+
- ~ Eodhd::Validations: Move validate_arguments() from Client to Validations.
|
|
49
|
+
- ~ Eodhd::Validations: Remove ! from all validation methods (validate_exchange_code, validate_symbol, etc).
|
|
50
|
+
- ~ Eodhd::WebSocketClient: Use DefaultLogger, add logger attribute.
|
|
51
|
+
- ~ Eodhd::WebSocketClient#initialize: + logger, use_default_logger arguments.
|
|
52
|
+
- + Eodhd::WebSocketClient#use_logging?: Check if logging is enabled.
|
|
53
|
+
- ~ Eodhd::WebSocketClient::Handler: Remove duplicate logger code.
|
|
54
|
+
- ~ Eodhd::WebSocketClient::Handler#initialize: + logger argument.
|
|
55
|
+
- ~ Eodhd::WebSocketClient::Handler#handle_response: Fix JSON parsing with proper StandardError rescue.
|
|
56
|
+
- ~ Eodhd::WebSocketClient::Handler#log_error: Use instance logger with use_logging? check.
|
|
57
|
+
- + test/validations_test.rb: Comprehensive validation tests with edge cases.
|
|
58
|
+
- + test/client_test.rb: REST client tests with VCR for all endpoints.
|
|
59
|
+
- + test/eodhd_test.rb: Facade delegation tests.
|
|
60
|
+
- + test/web_socket_client_test.rb: WebSocket client tests with stubbed Iodine.
|
|
61
|
+
- + test/helper.rb: VCR configuration with WebMock.
|
|
62
|
+
- ~ eodhd.gemspec: Add iodine as runtime dependency.
|
|
63
|
+
- ~ .gitignore: + Gemfile.lock.
|
|
64
|
+
|
|
65
|
+
## [0.15.0] - 2025-09-16, Add validations, response logging, a version constant, and CHANGELOG.
|
|
66
|
+
- + Eodhd::Validations
|
|
67
|
+
- + Eodhd::Client#validate_arguments
|
|
68
|
+
- ~ Eodhd::Client#exchange_symbol_list: Use validate_arguments().
|
|
69
|
+
- ~ Eodhd::Client#eod_data: Use validate_arguments().
|
|
70
|
+
- ~ Eodhd::Client#eod_bulk_last_day: Use validate_arguments().
|
|
71
|
+
- + Eodhd::Client#log_response
|
|
72
|
+
- ~ Eodhd::Client#do_request: Call log_request() after construction of args.
|
|
73
|
+
- ~ Eodhd::Client#handle_response: Use log_response().
|
|
74
|
+
- + Eodhd::VERSION
|
|
75
|
+
- ~ eodhd.gemspec: Use Eodhd::VERSION and update the date.
|
|
76
|
+
- + CHANGELOG.txt
|
|
77
|
+
|
|
78
|
+
## [0.14.2] - 2025-03-26, Remove reference to currently unused library UnixTime.
|
|
79
|
+
- ~ Eodhd::WebSocketClient: - require 'UnixTime'
|
|
80
|
+
|
|
81
|
+
## [0.14.1] - 2025-03-23, Some fixes for the WebSocketClient interface.
|
|
82
|
+
- ~ Eodhd::WebSocketClient: + attr_accessor :consumer
|
|
83
|
+
- ~ Eodhd::WebSocketClient: /attr_accessor :symbols/attr_reader :symbols/
|
|
84
|
+
- + Eodhd::WebSocketClient#symbols=
|
|
85
|
+
|
|
86
|
+
## [0.14.0] - 2025-03-21, Add WebSockets.
|
|
87
|
+
- + Eodhd::WebSocketClient
|
|
88
|
+
- + Eodhd#web_socket
|
|
89
|
+
- + Eodhd#stream
|
|
90
|
+
- + Eodhd#us_quote_stream
|
|
91
|
+
- + Eodhd#us_trade_stream
|
|
92
|
+
- + Eodhd#forex_stream
|
|
93
|
+
- + Eodhd#crypto_stream
|
|
94
|
+
- ~ Eodhd::Error: lib/Eodhd/Client.rb --> lib/Eodhd/Error.rb
|
data/README.md
CHANGED
|
@@ -24,46 +24,118 @@ Or install it yourself as:
|
|
|
24
24
|
### Setup
|
|
25
25
|
```ruby
|
|
26
26
|
api_token = 'api_token'
|
|
27
|
-
|
|
27
|
+
eodhd = Eodhd.new(api_token: api_token)
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
### List of Exchanges
|
|
31
31
|
```ruby
|
|
32
|
-
|
|
32
|
+
eodhd.exchanges
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
### List of Exchange Symbols
|
|
36
36
|
```ruby
|
|
37
|
-
exchange =
|
|
37
|
+
exchange = eodhd.exchanges.first
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
eodhd.exchange_symbols(exchange: exchange)
|
|
40
40
|
# OR
|
|
41
|
-
|
|
41
|
+
eodhd.exchange_symbols(exchange_code: exchange.code)
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
### Retrieve EOD Data For One Symbol
|
|
45
45
|
```ruby
|
|
46
|
-
exchange =
|
|
47
|
-
exchange_symbol =
|
|
46
|
+
exchange = eodhd.exchanges.first
|
|
47
|
+
exchange_symbol = eodhd.exchange_symbols(exchange: exchange).first
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
eodhd.eod_data(exchange: exchange, exchange_symbol: exchange_symbol)
|
|
50
50
|
# OR
|
|
51
|
-
|
|
51
|
+
eodhd.eod_data(exchange_code: exchange.code, exchange_symbol: exchange_symbol)
|
|
52
52
|
# OR
|
|
53
|
-
|
|
53
|
+
eodhd.eod_data(exchange: exchange, symbol: exchange_symbol.code)
|
|
54
54
|
# OR
|
|
55
|
-
|
|
55
|
+
eodhd.eod_data(exchange_code: exchange.code, symbol: exchange_symbol.code)
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
### Retrieve EOD Data For Multiple Symbols For One Date
|
|
59
59
|
```ruby
|
|
60
|
-
exchange =
|
|
60
|
+
exchange = eodhd.exchanges.first
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
eodhd.eod_bulk_last_day(exchange: exchange, date: Date.today)
|
|
63
63
|
# OR
|
|
64
|
-
|
|
64
|
+
eodhd.eod_bulk_last_day(exchange_code: exchange.code, date: Date.today)
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
### Retrieve Intraday Data
|
|
68
|
+
```ruby
|
|
69
|
+
eodhd.intraday(symbol: 'AAPL', exchange_code: 'US', interval: '5m')
|
|
70
|
+
# OR with date range (from and to are Unix timestamps)
|
|
71
|
+
eodhd.intraday(symbol: 'AAPL', exchange_code: 'US', interval: '1h', from: 1696118400, to: 1696550400)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Retrieve Fundamental Data
|
|
75
|
+
```ruby
|
|
76
|
+
fd = eodhd.fundamentals(exchange_code: 'US', symbol: 'AAPL')
|
|
77
|
+
|
|
78
|
+
fd.general
|
|
79
|
+
fd.general.name
|
|
80
|
+
fd.general.sector
|
|
81
|
+
fd.general.industry
|
|
82
|
+
|
|
83
|
+
fd.highlights
|
|
84
|
+
fd.highlights.market_capitalization
|
|
85
|
+
fd.highlights.pe_ratio
|
|
86
|
+
fd.highlights.dividend_yield
|
|
87
|
+
fd.highlights.earnings_share
|
|
88
|
+
|
|
89
|
+
fd.valuation
|
|
90
|
+
fd.valuation.trailing_pe
|
|
91
|
+
fd.valuation.forward_pe
|
|
92
|
+
fd.valuation.price_book_mrq
|
|
93
|
+
|
|
94
|
+
fd.shares_stats
|
|
95
|
+
fd.shares_stats.shares_outstanding
|
|
96
|
+
fd.shares_stats.shares_float
|
|
97
|
+
|
|
98
|
+
fd.financials
|
|
99
|
+
fd.financials.income_statement
|
|
100
|
+
fd.financials.income_statement.quarterly
|
|
101
|
+
fd.financials.income_statement.yearly
|
|
102
|
+
fd.financials.balance_sheet.quarterly
|
|
103
|
+
fd.financials.cash_flow.quarterly
|
|
104
|
+
|
|
105
|
+
fd.earnings
|
|
106
|
+
fd.earnings.history
|
|
107
|
+
fd.earnings.trend
|
|
108
|
+
fd.earnings.annual
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### Use the filter parameter to request only specific sections
|
|
112
|
+
```ruby
|
|
113
|
+
eodhd.fundamentals(exchange_code: 'US', symbol: 'AAPL', filter: 'General')
|
|
114
|
+
eodhd.fundamentals(exchange_code: 'US', symbol: 'AAPL', filter: 'Financials::Income_Statement::quarterly')
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### WebSockets
|
|
118
|
+
|
|
119
|
+
#### Streaming requires a callable consumer (a proc, lambda, or any object responding to `call`) to handle incoming data frames
|
|
120
|
+
```ruby
|
|
121
|
+
consumer = ->(data){puts data}
|
|
122
|
+
eodhd = Eodhd.new(api_token: api_token, consumer: consumer)
|
|
123
|
+
|
|
124
|
+
eodhd.us_trade_stream('AAPL,MSFT')
|
|
125
|
+
eodhd.us_quote_stream('AAPL,MSFT')
|
|
126
|
+
eodhd.forex_stream('EURUSD')
|
|
127
|
+
eodhd.crypto_stream('BTC-USD')
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### Or use the general interface
|
|
131
|
+
```ruby
|
|
132
|
+
eodhd.stream(asset_class: 'us', symbols: 'AAPL,MSFT')
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
MIT License. See LICENSE file for details.
|
|
138
|
+
|
|
67
139
|
## Contributing
|
|
68
140
|
|
|
69
141
|
1. Fork it ( https://github.com/thoran/eodhd.rb/fork )
|
data/Rakefile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require 'rake/testtask'
|
|
2
|
+
|
|
3
|
+
Rake::TestTask.new(:test) do |t|
|
|
4
|
+
t.libs << "lib"
|
|
5
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
|
6
|
+
t.warning = true
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
task default: :test
|
|
10
|
+
|
|
11
|
+
namespace :cassettes do
|
|
12
|
+
CASSETTE_DIR = File.expand_path("test/fixtures/vcr_cassettes", __dir__)
|
|
13
|
+
|
|
14
|
+
desc "Delete all VCR cassettes"
|
|
15
|
+
task :clear do
|
|
16
|
+
if Dir.exist?(CASSETTE_DIR)
|
|
17
|
+
FileUtils.rm_rf(Dir[File.join(CASSETTE_DIR, "**", "*")])
|
|
18
|
+
puts "Cleared cassettes in #{CASSETTE_DIR}"
|
|
19
|
+
else
|
|
20
|
+
puts "Cassette dir not found: #{CASSETTE_DIR}"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
desc "Show cassette directory path"
|
|
25
|
+
task :path do
|
|
26
|
+
puts CASSETTE_DIR
|
|
27
|
+
end
|
|
28
|
+
end
|
data/eodhd.rb.gemspec
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
require_relative './lib/Eodhd/VERSION'
|
|
2
2
|
|
|
3
|
+
class Gem::Specification
|
|
4
|
+
def dependencies=(gems)
|
|
5
|
+
gems.each{|gem| add_dependency(*gem)}
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def development_dependencies=(gems)
|
|
9
|
+
gems.each{|gem| add_development_dependency(*gem)}
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
3
13
|
Gem::Specification.new do |spec|
|
|
4
14
|
spec.name = 'eodhd.rb'
|
|
5
15
|
|
|
6
16
|
spec.version = Eodhd::VERSION
|
|
7
|
-
spec.date = '
|
|
17
|
+
spec.date = '2026-03-19'
|
|
8
18
|
|
|
9
19
|
spec.summary = "Access the eodhd.com API with Ruby."
|
|
10
20
|
spec.description = "Access the eodhd.com API with Ruby."
|
|
@@ -12,26 +22,34 @@ Gem::Specification.new do |spec|
|
|
|
12
22
|
spec.author = 'thoran'
|
|
13
23
|
spec.email = 'code@thoran.com'
|
|
14
24
|
spec.homepage = 'http://github.com/thoran/eodhd.rb'
|
|
15
|
-
spec.license = '
|
|
16
|
-
|
|
17
|
-
spec.required_ruby_version = '>= 2.5'
|
|
25
|
+
spec.license = 'MIT'
|
|
18
26
|
|
|
19
|
-
spec.
|
|
20
|
-
spec.add_dependency('iodine')
|
|
21
|
-
|
|
22
|
-
spec.add_development_dependency('rake')
|
|
23
|
-
spec.add_development_dependency('minitest')
|
|
24
|
-
spec.add_development_dependency('minitest-spec-context')
|
|
25
|
-
spec.add_development_dependency('webmock')
|
|
26
|
-
spec.add_development_dependency('vcr')
|
|
27
|
-
spec.add_development_dependency('simplecov')
|
|
27
|
+
spec.required_ruby_version = '>= 2.7'
|
|
28
28
|
|
|
29
29
|
spec.files = [
|
|
30
|
+
'CHANGELOG',
|
|
30
31
|
'eodhd.rb.gemspec',
|
|
31
32
|
'Gemfile',
|
|
32
33
|
Dir['lib/**/*.rb'],
|
|
34
|
+
'Rakefile',
|
|
33
35
|
'README.md',
|
|
34
36
|
Dir['test/**/*.rb']
|
|
35
37
|
].flatten
|
|
38
|
+
|
|
36
39
|
spec.require_paths = ['lib']
|
|
40
|
+
|
|
41
|
+
spec.dependencies = %w{
|
|
42
|
+
http.rb
|
|
43
|
+
iodine
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
spec.development_dependencies = %w{
|
|
47
|
+
rake
|
|
48
|
+
minitest
|
|
49
|
+
minitest-mock
|
|
50
|
+
minitest-spec-context
|
|
51
|
+
webmock
|
|
52
|
+
vcr
|
|
53
|
+
simplecov
|
|
54
|
+
}
|
|
37
55
|
end
|
data/lib/Eodhd/Client.rb
CHANGED
|
@@ -69,6 +69,13 @@ class Eodhd
|
|
|
69
69
|
handle_response(response)
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
+
def fundamentals(exchange_code:, symbol:, filter: nil)
|
|
73
|
+
validate_arguments(exchange_code: exchange_code, symbol: symbol)
|
|
74
|
+
args = {filter: filter}.compact
|
|
75
|
+
response = get(path: "/fundamentals/#{symbol}.#{exchange_code}", args: args)
|
|
76
|
+
handle_response(response)
|
|
77
|
+
end
|
|
78
|
+
|
|
72
79
|
attr_accessor\
|
|
73
80
|
:api_token,
|
|
74
81
|
:logger
|
data/lib/Eodhd/EodBulkLastDay.rb
CHANGED
data/lib/Eodhd/EodData.rb
CHANGED
data/lib/Eodhd/Exchange.rb
CHANGED
data/lib/Eodhd/ExchangeSymbol.rb
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Eodhd/Fundamentals/AnalystRatings.rb
|
|
2
|
+
# Eodhd::Fundamentals::AnalystRatings
|
|
3
|
+
|
|
4
|
+
class Eodhd
|
|
5
|
+
class Fundamentals
|
|
6
|
+
class AnalystRatings
|
|
7
|
+
attr_reader\
|
|
8
|
+
:rating,
|
|
9
|
+
:target_price,
|
|
10
|
+
:strong_buy,
|
|
11
|
+
:buy,
|
|
12
|
+
:hold,
|
|
13
|
+
:sell,
|
|
14
|
+
:strong_sell
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def initialize(data)
|
|
19
|
+
@rating = data['Rating']
|
|
20
|
+
@target_price = data['TargetPrice']
|
|
21
|
+
@strong_buy = data['StrongBuy']
|
|
22
|
+
@buy = data['Buy']
|
|
23
|
+
@hold = data['Hold']
|
|
24
|
+
@sell = data['Sell']
|
|
25
|
+
@strong_sell = data['StrongSell']
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Eodhd/Fundamentals/ESGScores.rb
|
|
2
|
+
# Eodhd::Fundamentals::ESGScores
|
|
3
|
+
|
|
4
|
+
class Eodhd
|
|
5
|
+
class Fundamentals
|
|
6
|
+
class ESGScores
|
|
7
|
+
attr_reader\
|
|
8
|
+
:rating_date,
|
|
9
|
+
:total_esg,
|
|
10
|
+
:total_esg_percentile,
|
|
11
|
+
:environment_score,
|
|
12
|
+
:environment_score_percentile,
|
|
13
|
+
:social_score,
|
|
14
|
+
:social_score_percentile,
|
|
15
|
+
:governance_score,
|
|
16
|
+
:governance_score_percentile,
|
|
17
|
+
:controversy_level,
|
|
18
|
+
:activities_involvement
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def initialize(data)
|
|
23
|
+
@rating_date = data['RatingDate']
|
|
24
|
+
@total_esg = data['TotalEsg']
|
|
25
|
+
@total_esg_percentile = data['TotalEsgPercentile']
|
|
26
|
+
@environment_score = data['EnvironmentScore']
|
|
27
|
+
@environment_score_percentile = data['EnvironmentScorePercentile']
|
|
28
|
+
@social_score = data['SocialScore']
|
|
29
|
+
@social_score_percentile = data['SocialScorePercentile']
|
|
30
|
+
@governance_score = data['GovernanceScore']
|
|
31
|
+
@governance_score_percentile = data['GovernanceScorePercentile']
|
|
32
|
+
@controversy_level = data['ControversyLevel']
|
|
33
|
+
@activities_involvement = data['ActivitiesInvolvement']
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Eodhd/Fundamentals/Earnings.rb
|
|
2
|
+
# Eodhd::Fundamentals::Earnings
|
|
3
|
+
|
|
4
|
+
class Eodhd
|
|
5
|
+
class Fundamentals
|
|
6
|
+
class Earnings
|
|
7
|
+
attr_reader\
|
|
8
|
+
:history,
|
|
9
|
+
:trend,
|
|
10
|
+
:annual
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def initialize(data)
|
|
15
|
+
@history = data['History']
|
|
16
|
+
@trend = data['Trend']
|
|
17
|
+
@annual = data['Annual']
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Eodhd/Fundamentals/Financials/Statement.rb
|
|
2
|
+
# Eodhd::Fundamentals::Financials::Statement
|
|
3
|
+
|
|
4
|
+
class Eodhd
|
|
5
|
+
class Fundamentals
|
|
6
|
+
class Financials
|
|
7
|
+
class Statement
|
|
8
|
+
attr_reader\
|
|
9
|
+
:quarterly,
|
|
10
|
+
:yearly
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def initialize(data)
|
|
15
|
+
@quarterly = data['quarterly']
|
|
16
|
+
@yearly = data['yearly']
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Eodhd/Fundamentals/Financials.rb
|
|
2
|
+
# Eodhd::Fundamentals::Financials
|
|
3
|
+
|
|
4
|
+
require_relative './Financials/Statement'
|
|
5
|
+
|
|
6
|
+
class Eodhd
|
|
7
|
+
class Fundamentals
|
|
8
|
+
class Financials
|
|
9
|
+
attr_reader\
|
|
10
|
+
:income_statement,
|
|
11
|
+
:balance_sheet,
|
|
12
|
+
:cash_flow
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def initialize(data)
|
|
17
|
+
@income_statement = Statement.new(data['Income_Statement']) if data['Income_Statement']
|
|
18
|
+
@balance_sheet = Statement.new(data['Balance_Sheet']) if data['Balance_Sheet']
|
|
19
|
+
@cash_flow = Statement.new(data['Cash_Flow']) if data['Cash_Flow']
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Eodhd/Fundamentals/General.rb
|
|
2
|
+
# Eodhd::Fundamentals::General
|
|
3
|
+
|
|
4
|
+
class Eodhd
|
|
5
|
+
class Fundamentals
|
|
6
|
+
class General
|
|
7
|
+
attr_reader\
|
|
8
|
+
:code,
|
|
9
|
+
:type,
|
|
10
|
+
:name,
|
|
11
|
+
:exchange,
|
|
12
|
+
:currency_code,
|
|
13
|
+
:currency_name,
|
|
14
|
+
:currency_symbol,
|
|
15
|
+
:country_name,
|
|
16
|
+
:country_iso,
|
|
17
|
+
:isin,
|
|
18
|
+
:lei,
|
|
19
|
+
:cusip,
|
|
20
|
+
:cik,
|
|
21
|
+
:employer_id_number,
|
|
22
|
+
:fiscal_year_end,
|
|
23
|
+
:ipo_date,
|
|
24
|
+
:international_domestic,
|
|
25
|
+
:sector,
|
|
26
|
+
:industry,
|
|
27
|
+
:gic_sector,
|
|
28
|
+
:gic_group,
|
|
29
|
+
:gic_industry,
|
|
30
|
+
:gic_sub_industry,
|
|
31
|
+
:home_category,
|
|
32
|
+
:is_delisted,
|
|
33
|
+
:description,
|
|
34
|
+
:address,
|
|
35
|
+
:address_data,
|
|
36
|
+
:listings,
|
|
37
|
+
:officers,
|
|
38
|
+
:phone,
|
|
39
|
+
:web_url,
|
|
40
|
+
:logo_url,
|
|
41
|
+
:full_time_employees,
|
|
42
|
+
:updated_at
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
46
|
+
def initialize(data)
|
|
47
|
+
@code = data['Code']
|
|
48
|
+
@type = data['Type']
|
|
49
|
+
@name = data['Name']
|
|
50
|
+
@exchange = data['Exchange']
|
|
51
|
+
@currency_code = data['CurrencyCode']
|
|
52
|
+
@currency_name = data['CurrencyName']
|
|
53
|
+
@currency_symbol = data['CurrencySymbol']
|
|
54
|
+
@country_name = data['CountryName']
|
|
55
|
+
@country_iso = data['CountryISO']
|
|
56
|
+
@isin = data['ISIN']
|
|
57
|
+
@lei = data['LEI']
|
|
58
|
+
@cusip = data['CUSIP']
|
|
59
|
+
@cik = data['CIK']
|
|
60
|
+
@employer_id_number = data['EmployerIdNumber']
|
|
61
|
+
@fiscal_year_end = data['FiscalYearEnd']
|
|
62
|
+
@ipo_date = data['IPODate']
|
|
63
|
+
@international_domestic = data['InternationalDomestic']
|
|
64
|
+
@sector = data['Sector']
|
|
65
|
+
@industry = data['Industry']
|
|
66
|
+
@gic_sector = data['GicSector']
|
|
67
|
+
@gic_group = data['GicGroup']
|
|
68
|
+
@gic_industry = data['GicIndustry']
|
|
69
|
+
@gic_sub_industry = data['GicSubIndustry']
|
|
70
|
+
@home_category = data['HomeCategory']
|
|
71
|
+
@is_delisted = data['IsDelisted']
|
|
72
|
+
@description = data['Description']
|
|
73
|
+
@address = data['Address']
|
|
74
|
+
@address_data = data['AddressData']
|
|
75
|
+
@listings = data['Listings']
|
|
76
|
+
@officers = data['Officers']
|
|
77
|
+
@phone = data['Phone']
|
|
78
|
+
@web_url = data['WebURL']
|
|
79
|
+
@logo_url = data['LogoURL']
|
|
80
|
+
@full_time_employees = data['FullTimeEmployees']
|
|
81
|
+
@updated_at = data['UpdatedAt']
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Eodhd/Fundamentals/Highlights.rb
|
|
2
|
+
# Eodhd::Fundamentals::Highlights
|
|
3
|
+
|
|
4
|
+
class Eodhd
|
|
5
|
+
class Fundamentals
|
|
6
|
+
class Highlights
|
|
7
|
+
attr_reader\
|
|
8
|
+
:market_capitalization,
|
|
9
|
+
:ebitda,
|
|
10
|
+
:pe_ratio,
|
|
11
|
+
:peg_ratio,
|
|
12
|
+
:wall_street_target_price,
|
|
13
|
+
:book_value,
|
|
14
|
+
:dividend_share,
|
|
15
|
+
:dividend_yield,
|
|
16
|
+
:earnings_share,
|
|
17
|
+
:eps_estimate_current_year,
|
|
18
|
+
:eps_estimate_next_year,
|
|
19
|
+
:eps_estimate_next_quarter,
|
|
20
|
+
:eps_estimate_current_quarter,
|
|
21
|
+
:most_recent_quarter,
|
|
22
|
+
:profit_margin,
|
|
23
|
+
:operating_margin_ttm,
|
|
24
|
+
:return_on_assets_ttm,
|
|
25
|
+
:return_on_equity_ttm,
|
|
26
|
+
:revenue_ttm,
|
|
27
|
+
:revenue_per_share_ttm,
|
|
28
|
+
:quarterly_revenue_growth_yoy,
|
|
29
|
+
:gross_profit_ttm,
|
|
30
|
+
:diluted_eps_ttm,
|
|
31
|
+
:quarterly_earnings_growth_yoy
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def initialize(data)
|
|
36
|
+
@market_capitalization = data['MarketCapitalization']
|
|
37
|
+
@ebitda = data['EBITDA']
|
|
38
|
+
@pe_ratio = data['PERatio']
|
|
39
|
+
@peg_ratio = data['PEGRatio']
|
|
40
|
+
@wall_street_target_price = data['WallStreetTargetPrice']
|
|
41
|
+
@book_value = data['BookValue']
|
|
42
|
+
@dividend_share = data['DividendShare']
|
|
43
|
+
@dividend_yield = data['DividendYield']
|
|
44
|
+
@earnings_share = data['EarningsShare']
|
|
45
|
+
@eps_estimate_current_year = data['EPSEstimateCurrentYear']
|
|
46
|
+
@eps_estimate_next_year = data['EPSEstimateNextYear']
|
|
47
|
+
@eps_estimate_next_quarter = data['EPSEstimateNextQuarter']
|
|
48
|
+
@eps_estimate_current_quarter = data['EPSEstimateCurrentQuarter']
|
|
49
|
+
@most_recent_quarter = data['MostRecentQuarter']
|
|
50
|
+
@profit_margin = data['ProfitMargin']
|
|
51
|
+
@operating_margin_ttm = data['OperatingMarginTTM']
|
|
52
|
+
@return_on_assets_ttm = data['ReturnOnAssetsTTM']
|
|
53
|
+
@return_on_equity_ttm = data['ReturnOnEquityTTM']
|
|
54
|
+
@revenue_ttm = data['RevenueTTM']
|
|
55
|
+
@revenue_per_share_ttm = data['RevenuePerShareTTM']
|
|
56
|
+
@quarterly_revenue_growth_yoy = data['QuarterlyRevenueGrowthYOY']
|
|
57
|
+
@gross_profit_ttm = data['GrossProfitTTM']
|
|
58
|
+
@diluted_eps_ttm = data['DilutedEpsTTM']
|
|
59
|
+
@quarterly_earnings_growth_yoy = data['QuarterlyEarningsGrowthYOY']
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|