eodhd 0.19.5

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.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +195 -0
  3. data/Gemfile +3 -0
  4. data/README.md +160 -0
  5. data/Rakefile +28 -0
  6. data/eodhd.gemspec +52 -0
  7. data/lib/Eodhd/Client.rb +143 -0
  8. data/lib/Eodhd/DefaultLogger.rb +30 -0
  9. data/lib/Eodhd/EodBulkLastDay.rb +56 -0
  10. data/lib/Eodhd/EodData.rb +56 -0
  11. data/lib/Eodhd/Error.rb +16 -0
  12. data/lib/Eodhd/Exchange.rb +50 -0
  13. data/lib/Eodhd/ExchangeSymbol.rb +50 -0
  14. data/lib/Eodhd/Fundamentals/AnalystRatings.rb +29 -0
  15. data/lib/Eodhd/Fundamentals/ESGScores.rb +37 -0
  16. data/lib/Eodhd/Fundamentals/Earnings/AnnualEntry.rb +21 -0
  17. data/lib/Eodhd/Fundamentals/Earnings/HistoryEntry.rb +33 -0
  18. data/lib/Eodhd/Fundamentals/Earnings/TrendEntry.rb +65 -0
  19. data/lib/Eodhd/Fundamentals/Earnings.rb +30 -0
  20. data/lib/Eodhd/Fundamentals/Financials/BalanceSheet/Entry.rb +147 -0
  21. data/lib/Eodhd/Fundamentals/Financials/BalanceSheet.rb +28 -0
  22. data/lib/Eodhd/Fundamentals/Financials/CashFlow/Entry.rb +83 -0
  23. data/lib/Eodhd/Fundamentals/Financials/CashFlow.rb +28 -0
  24. data/lib/Eodhd/Fundamentals/Financials/IncomeStatement/Entry.rb +87 -0
  25. data/lib/Eodhd/Fundamentals/Financials/IncomeStatement.rb +28 -0
  26. data/lib/Eodhd/Fundamentals/Financials.rb +25 -0
  27. data/lib/Eodhd/Fundamentals/General.rb +85 -0
  28. data/lib/Eodhd/Fundamentals/Highlights.rb +63 -0
  29. data/lib/Eodhd/Fundamentals/Holders/Fund.rb +31 -0
  30. data/lib/Eodhd/Fundamentals/Holders/Institution.rb +31 -0
  31. data/lib/Eodhd/Fundamentals/Holders.rb +27 -0
  32. data/lib/Eodhd/Fundamentals/InsiderTransaction.rb +35 -0
  33. data/lib/Eodhd/Fundamentals/OutstandingShares/Entry.rb +25 -0
  34. data/lib/Eodhd/Fundamentals/OutstandingShares.rb +26 -0
  35. data/lib/Eodhd/Fundamentals/SharesStats.rb +33 -0
  36. data/lib/Eodhd/Fundamentals/SplitsDividends.rb +31 -0
  37. data/lib/Eodhd/Fundamentals/Technicals.rb +33 -0
  38. data/lib/Eodhd/Fundamentals/Valuation.rb +29 -0
  39. data/lib/Eodhd/Fundamentals.rb +92 -0
  40. data/lib/Eodhd/Intraday.rb +76 -0
  41. data/lib/Eodhd/VERSION.rb +3 -0
  42. data/lib/Eodhd/Validations.rb +78 -0
  43. data/lib/Eodhd/WebSocketClient.rb +130 -0
  44. data/lib/Hash/x_www_form_urlencode.rb +7 -0
  45. data/lib/Thoran/Hash/XWwwFormUrlencode/x_www_form_urlencode.rb +27 -0
  46. data/lib/Thoran/String/Urlencode/urlencode.rb +29 -0
  47. data/lib/eodhd.rb +78 -0
  48. data/test/Eodhd/Client_test.rb +111 -0
  49. data/test/Eodhd/Fundamentals_test.rb +163 -0
  50. data/test/Eodhd/VERSION_test.rb +20 -0
  51. data/test/Eodhd/Validations_test.rb +135 -0
  52. data/test/Eodhd/WebSocketClient_test.rb +99 -0
  53. data/test/Eodhd_test.rb +73 -0
  54. data/test/helper.rb +17 -0
  55. metadata +218 -0
@@ -0,0 +1,56 @@
1
+ # Eodhd/EodData.rb
2
+ # Eodhd::EodData
3
+
4
+ class Eodhd
5
+ class EodData
6
+ class << self
7
+ def all(client: nil, api_token: nil, exchange_code:, symbol:, period: 'd', from: nil, to: nil)
8
+ load(client: client, api_token: api_token, exchange_code: exchange_code, symbol: symbol, period: period, from: from, to: to)
9
+ end
10
+
11
+ private
12
+
13
+ def load(client: nil, api_token: nil, exchange_code:, symbol:, period:, from:, to:)
14
+ client ||= Client.new(api_token: api_token)
15
+ client.eod_data(exchange_id: exchange_code, symbol: symbol, period: period, from: from, to: to).collect do |eod_data|
16
+ self.new(
17
+ exchange_code: eod_data['exchange_code'],
18
+ symbol: eod_data['symbol'],
19
+ date: eod_data['date'],
20
+ open: eod_data['open'],
21
+ high: eod_data['high'],
22
+ low: eod_data['low'],
23
+ close: eod_data['close'],
24
+ adjusted_close: eod_data['adjusted_close'],
25
+ volume: eod_data['volume']
26
+ )
27
+ end
28
+ end
29
+ end # class << self
30
+
31
+ attr_reader\
32
+ :exchange_code,
33
+ :symbol,
34
+ :date,
35
+ :open,
36
+ :high,
37
+ :low,
38
+ :close,
39
+ :adjusted_close,
40
+ :volume
41
+
42
+ private
43
+
44
+ def initialize(exchange_code:, symbol:, date:, open:, high:, low:, close:, adjusted_close:, volume:)
45
+ @exchange_code = exchange_code
46
+ @symbol = symbol
47
+ @date = date
48
+ @open = open
49
+ @high = high
50
+ @low = low
51
+ @close = close
52
+ @adjusted_close = adjusted_close
53
+ @volume = volume
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,16 @@
1
+ # Eodhd/Error.rb
2
+ # Eodhd::Error
3
+
4
+ class Eodhd
5
+ class Error < RuntimeError
6
+ attr_reader :code, :message, :body
7
+
8
+ private
9
+
10
+ def initialize(code:, message:, body:)
11
+ @code = code
12
+ @message = message
13
+ @body = body
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,50 @@
1
+ # Eodhd/Exchange.rb
2
+ # Eodhd::Exchange
3
+
4
+ class Eodhd
5
+ class Exchange
6
+ class << self
7
+ def all(client: nil, api_token: nil)
8
+ load(client: client, api_token: api_token)
9
+ end
10
+
11
+ private
12
+
13
+ def load(client: nil, api_token: nil)
14
+ client ||= Client.new(api_token: api_token)
15
+ client.exchanges_list.collect do |exchange|
16
+ self.new(
17
+ name: exchange['Name'],
18
+ code: exchange['Code'],
19
+ operating_mic: exchange['OperatingMIC'],
20
+ country: exchange['Country'],
21
+ currency: exchange['Currency'],
22
+ country_iso2: exchange['CountryISO2'],
23
+ country_iso3: exchange['CountryISO3']
24
+ )
25
+ end
26
+ end
27
+ end # class << self
28
+
29
+ attr_reader\
30
+ :name,
31
+ :code,
32
+ :operating_mic,
33
+ :country,
34
+ :currency,
35
+ :country_iso2,
36
+ :country_iso3
37
+
38
+ private
39
+
40
+ def initialize(name:, code:, operating_mic:, country:, currency:, country_iso2:, country_iso3:)
41
+ @name = name
42
+ @code = code
43
+ @operating_mic = operating_mic
44
+ @country = country
45
+ @currency = currency
46
+ @country_iso2 = country_iso2
47
+ @country_iso3 = country_iso3
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,50 @@
1
+ # Eodhd/ExchangeSymbol.rb
2
+ # Eodhd::ExchangeSymbol
3
+
4
+ class Eodhd
5
+ class ExchangeSymbol
6
+ class << self
7
+ def all(client: nil, api_token: nil, exchange_code: nil)
8
+ load(client: client, api_token: api_token, exchange_code: exchange_code)
9
+ end
10
+
11
+ private
12
+
13
+ def load(client: nil, api_token: nil, exchange_code: nil)
14
+ client ||= Client.new(api_token: api_token)
15
+ client.exchange_symbol_list(exchange_code: exchange_code).collect do |symbol|
16
+ self.new(
17
+ code: symbol['Code'],
18
+ name: symbol['Name'],
19
+ country: symbol['Country'],
20
+ exchange: symbol['Exchange'],
21
+ currency: symbol['Currency'],
22
+ type: symbol['Type'],
23
+ isin: symbol['Isin']
24
+ )
25
+ end
26
+ end
27
+ end # class << self
28
+
29
+ attr_reader\
30
+ :code,
31
+ :name,
32
+ :country,
33
+ :exchange,
34
+ :currency,
35
+ :type,
36
+ :isin
37
+
38
+ private
39
+
40
+ def initialize(code:, name:, country:, exchange:, currency:, type:, isin:)
41
+ @code = code
42
+ @name = name
43
+ @country = country
44
+ @exchange = exchange
45
+ @currency = currency
46
+ @type = type
47
+ @isin = isin
48
+ end
49
+ end
50
+ end
@@ -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/AnnualEntry.rb
2
+ # Eodhd::Fundamentals::Earnings::AnnualEntry
3
+
4
+ class Eodhd
5
+ class Fundamentals
6
+ class Earnings
7
+ class AnnualEntry
8
+ attr_reader\
9
+ :date,
10
+ :eps_actual
11
+
12
+ private
13
+
14
+ def initialize(data)
15
+ @date = data['date']
16
+ @eps_actual = data['epsActual']
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,33 @@
1
+ # Eodhd/Fundamentals/Earnings/HistoryEntry.rb
2
+ # Eodhd::Fundamentals::Earnings::HistoryEntry
3
+
4
+ class Eodhd
5
+ class Fundamentals
6
+ class Earnings
7
+ class HistoryEntry
8
+ attr_reader\
9
+ :report_date,
10
+ :date,
11
+ :before_after_market,
12
+ :currency,
13
+ :eps_actual,
14
+ :eps_estimate,
15
+ :eps_difference,
16
+ :surprise_percent
17
+
18
+ private
19
+
20
+ def initialize(data)
21
+ @report_date = data['reportDate']
22
+ @date = data['date']
23
+ @before_after_market = data['beforeAfterMarket']
24
+ @currency = data['currency']
25
+ @eps_actual = data['epsActual']
26
+ @eps_estimate = data['epsEstimate']
27
+ @eps_difference = data['epsDifference']
28
+ @surprise_percent = data['surprisePercent']
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,65 @@
1
+ # Eodhd/Fundamentals/Earnings/TrendEntry.rb
2
+ # Eodhd::Fundamentals::Earnings::TrendEntry
3
+
4
+ class Eodhd
5
+ class Fundamentals
6
+ class Earnings
7
+ class TrendEntry
8
+ attr_reader\
9
+ :date,
10
+ :period,
11
+ :growth,
12
+ :earnings_estimate_avg,
13
+ :earnings_estimate_low,
14
+ :earnings_estimate_high,
15
+ :earnings_estimate_year_ago_eps,
16
+ :earnings_estimate_number_of_analysts,
17
+ :earnings_estimate_growth,
18
+ :revenue_estimate_avg,
19
+ :revenue_estimate_low,
20
+ :revenue_estimate_high,
21
+ :revenue_estimate_year_ago_eps,
22
+ :revenue_estimate_number_of_analysts,
23
+ :revenue_estimate_growth,
24
+ :eps_trend_current,
25
+ :eps_trend_7_days_ago,
26
+ :eps_trend_30_days_ago,
27
+ :eps_trend_60_days_ago,
28
+ :eps_trend_90_days_ago,
29
+ :eps_revisions_up_last_7_days,
30
+ :eps_revisions_up_last_30_days,
31
+ :eps_revisions_down_last_7_days,
32
+ :eps_revisions_down_last_30_days
33
+
34
+ private
35
+
36
+ def initialize(data)
37
+ @date = data['date']
38
+ @period = data['period']
39
+ @growth = data['growth']
40
+ @earnings_estimate_avg = data['earningsEstimateAvg']
41
+ @earnings_estimate_low = data['earningsEstimateLow']
42
+ @earnings_estimate_high = data['earningsEstimateHigh']
43
+ @earnings_estimate_year_ago_eps = data['earningsEstimateYearAgoEps']
44
+ @earnings_estimate_number_of_analysts = data['earningsEstimateNumberOfAnalysts']
45
+ @earnings_estimate_growth = data['earningsEstimateGrowth']
46
+ @revenue_estimate_avg = data['revenueEstimateAvg']
47
+ @revenue_estimate_low = data['revenueEstimateLow']
48
+ @revenue_estimate_high = data['revenueEstimateHigh']
49
+ @revenue_estimate_year_ago_eps = data['revenueEstimateYearAgoEps']
50
+ @revenue_estimate_number_of_analysts = data['revenueEstimateNumberOfAnalysts']
51
+ @revenue_estimate_growth = data['revenueEstimateGrowth']
52
+ @eps_trend_current = data['epsTrendCurrent']
53
+ @eps_trend_7_days_ago = data['epsTrend7daysAgo']
54
+ @eps_trend_30_days_ago = data['epsTrend30daysAgo']
55
+ @eps_trend_60_days_ago = data['epsTrend60daysAgo']
56
+ @eps_trend_90_days_ago = data['epsTrend90daysAgo']
57
+ @eps_revisions_up_last_7_days = data['epsRevisionsUpLast7days']
58
+ @eps_revisions_up_last_30_days = data['epsRevisionsUpLast30days']
59
+ @eps_revisions_down_last_7_days = data['epsRevisionsDownLast7days']
60
+ @eps_revisions_down_last_30_days = data['epsRevisionsDownLast30days']
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,30 @@
1
+ # Eodhd/Fundamentals/Earnings.rb
2
+ # Eodhd::Fundamentals::Earnings
3
+
4
+ require_relative './Earnings/AnnualEntry'
5
+ require_relative './Earnings/HistoryEntry'
6
+ require_relative './Earnings/TrendEntry'
7
+
8
+ class Eodhd
9
+ class Fundamentals
10
+ class Earnings
11
+ attr_reader\
12
+ :history,
13
+ :trend,
14
+ :annual
15
+
16
+ private
17
+
18
+ def initialize(data)
19
+ @annual = wrap(data['Annual'], AnnualEntry)
20
+ @history = wrap(data['History'], HistoryEntry)
21
+ @trend = wrap(data['Trend'], TrendEntry)
22
+ end
23
+
24
+ def wrap(entries, entry_class)
25
+ return [] unless entries
26
+ entries.values.map{|entry| entry_class.new(entry)}.sort_by(&:date)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,147 @@
1
+ # Eodhd/Fundamentals/Financials/BalanceSheet/Entry.rb
2
+ # Eodhd::Fundamentals::Financials::BalanceSheet::Entry
3
+
4
+ class Eodhd
5
+ class Fundamentals
6
+ class Financials
7
+ class BalanceSheet
8
+ class Entry
9
+ attr_reader\
10
+ :date,
11
+ :filing_date,
12
+ :currency_symbol,
13
+ :total_assets,
14
+ :intangible_assets,
15
+ :earning_assets,
16
+ :other_current_assets,
17
+ :total_liabilities,
18
+ :total_stockholder_equity,
19
+ :deferred_long_term_liabilities,
20
+ :other_current_liabilities,
21
+ :common_stock,
22
+ :capital_stock,
23
+ :retained_earnings,
24
+ :other_liabilities,
25
+ :goodwill,
26
+ :other_assets,
27
+ :cash,
28
+ :cash_and_equivalents,
29
+ :total_current_liabilities,
30
+ :current_deferred_revenue,
31
+ :net_debt,
32
+ :short_term_debt,
33
+ :short_long_term_debt,
34
+ :short_long_term_debt_total,
35
+ :other_stockholder_equity,
36
+ :property_plant_equipment,
37
+ :total_current_assets,
38
+ :long_term_investments,
39
+ :net_tangible_assets,
40
+ :short_term_investments,
41
+ :net_receivables,
42
+ :long_term_debt,
43
+ :inventory,
44
+ :accounts_payable,
45
+ :total_permanent_equity,
46
+ :noncontrolling_interest_in_consolidated_entity,
47
+ :temporary_equity_redeemable_noncontrolling_interests,
48
+ :accumulated_other_comprehensive_income,
49
+ :additional_paid_in_capital,
50
+ :common_stock_total_equity,
51
+ :preferred_stock_total_equity,
52
+ :retained_earnings_total_equity,
53
+ :treasury_stock,
54
+ :accumulated_amortization,
55
+ :non_current_assets_other,
56
+ :deferred_long_term_asset_charges,
57
+ :non_current_assets_total,
58
+ :capital_lease_obligations,
59
+ :long_term_debt_total,
60
+ :non_current_liabilities_other,
61
+ :non_current_liabilities_total,
62
+ :negative_goodwill,
63
+ :warrants,
64
+ :preferred_stock_redeemable,
65
+ :capital_surplus,
66
+ :liabilities_and_stockholders_equity,
67
+ :cash_and_short_term_investments,
68
+ :property_plant_and_equipment_gross,
69
+ :property_plant_and_equipment_net,
70
+ :accumulated_depreciation,
71
+ :net_working_capital,
72
+ :net_invested_capital,
73
+ :common_stock_shares_outstanding
74
+
75
+ private
76
+
77
+ def initialize(data)
78
+ @date = data['date']
79
+ @filing_date = data['filing_date']
80
+ @currency_symbol = data['currency_symbol']
81
+ @total_assets = data['totalAssets']
82
+ @intangible_assets = data['intangibleAssets']
83
+ @earning_assets = data['earningAssets']
84
+ @other_current_assets = data['otherCurrentAssets']
85
+ @total_liabilities = data['totalLiab']
86
+ @total_stockholder_equity = data['totalStockholderEquity']
87
+ @deferred_long_term_liabilities = data['deferredLongTermLiab']
88
+ @other_current_liabilities = data['otherCurrentLiab']
89
+ @common_stock = data['commonStock']
90
+ @capital_stock = data['capitalStock']
91
+ @retained_earnings = data['retainedEarnings']
92
+ @other_liabilities = data['otherLiab']
93
+ @goodwill = data['goodWill']
94
+ @other_assets = data['otherAssets']
95
+ @cash = data['cash']
96
+ @cash_and_equivalents = data['cashAndEquivalents']
97
+ @total_current_liabilities = data['totalCurrentLiabilities']
98
+ @current_deferred_revenue = data['currentDeferredRevenue']
99
+ @net_debt = data['netDebt']
100
+ @short_term_debt = data['shortTermDebt']
101
+ @short_long_term_debt = data['shortLongTermDebt']
102
+ @short_long_term_debt_total = data['shortLongTermDebtTotal']
103
+ @other_stockholder_equity = data['otherStockholderEquity']
104
+ @property_plant_equipment = data['propertyPlantEquipment']
105
+ @total_current_assets = data['totalCurrentAssets']
106
+ @long_term_investments = data['longTermInvestments']
107
+ @net_tangible_assets = data['netTangibleAssets']
108
+ @short_term_investments = data['shortTermInvestments']
109
+ @net_receivables = data['netReceivables']
110
+ @long_term_debt = data['longTermDebt']
111
+ @inventory = data['inventory']
112
+ @accounts_payable = data['accountsPayable']
113
+ @total_permanent_equity = data['totalPermanentEquity']
114
+ @noncontrolling_interest_in_consolidated_entity = data['noncontrollingInterestInConsolidatedEntity']
115
+ @temporary_equity_redeemable_noncontrolling_interests = data['temporaryEquityRedeemableNoncontrollingInterests']
116
+ @accumulated_other_comprehensive_income = data['accumulatedOtherComprehensiveIncome']
117
+ @additional_paid_in_capital = data['additionalPaidInCapital']
118
+ @common_stock_total_equity = data['commonStockTotalEquity']
119
+ @preferred_stock_total_equity = data['preferredStockTotalEquity']
120
+ @retained_earnings_total_equity = data['retainedEarningsTotalEquity']
121
+ @treasury_stock = data['treasuryStock']
122
+ @accumulated_amortization = data['accumulatedAmortization']
123
+ @non_current_assets_other = data['nonCurrrentAssetsOther']
124
+ @deferred_long_term_asset_charges = data['deferredLongTermAssetCharges']
125
+ @non_current_assets_total = data['nonCurrentAssetsTotal']
126
+ @capital_lease_obligations = data['capitalLeaseObligations']
127
+ @long_term_debt_total = data['longTermDebtTotal']
128
+ @non_current_liabilities_other = data['nonCurrentLiabilitiesOther']
129
+ @non_current_liabilities_total = data['nonCurrentLiabilitiesTotal']
130
+ @negative_goodwill = data['negativeGoodwill']
131
+ @warrants = data['warrants']
132
+ @preferred_stock_redeemable = data['preferredStockRedeemable']
133
+ @capital_surplus = data['capitalSurpluse']
134
+ @liabilities_and_stockholders_equity = data['liabilitiesAndStockholdersEquity']
135
+ @cash_and_short_term_investments = data['cashAndShortTermInvestments']
136
+ @property_plant_and_equipment_gross = data['propertyPlantAndEquipmentGross']
137
+ @property_plant_and_equipment_net = data['propertyPlantAndEquipmentNet']
138
+ @accumulated_depreciation = data['accumulatedDepreciation']
139
+ @net_working_capital = data['netWorkingCapital']
140
+ @net_invested_capital = data['netInvestedCapital']
141
+ @common_stock_shares_outstanding = data['commonStockSharesOutstanding']
142
+ end
143
+ end
144
+ end
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,28 @@
1
+ # Eodhd/Fundamentals/Financials/BalanceSheet.rb
2
+ # Eodhd::Fundamentals::Financials::BalanceSheet
3
+
4
+ require_relative './BalanceSheet/Entry'
5
+
6
+ class Eodhd
7
+ class Fundamentals
8
+ class Financials
9
+ class BalanceSheet
10
+ attr_reader\
11
+ :quarterly,
12
+ :yearly
13
+
14
+ private
15
+
16
+ def initialize(data)
17
+ @yearly = wrap(data['yearly'])
18
+ @quarterly = wrap(data['quarterly'])
19
+ end
20
+
21
+ def wrap(entries)
22
+ return [] unless entries
23
+ entries.values.map{|entry| Entry.new(entry)}.sort_by(&:date)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,83 @@
1
+ # Eodhd/Fundamentals/Financials/CashFlow/Entry.rb
2
+ # Eodhd::Fundamentals::Financials::CashFlow::Entry
3
+
4
+ class Eodhd
5
+ class Fundamentals
6
+ class Financials
7
+ class CashFlow
8
+ class Entry
9
+ attr_reader\
10
+ :date,
11
+ :filing_date,
12
+ :currency_symbol,
13
+ :investments,
14
+ :change_to_liabilities,
15
+ :total_cashflows_from_investing_activities,
16
+ :net_borrowings,
17
+ :total_cash_from_financing_activities,
18
+ :change_to_operating_activities,
19
+ :net_income,
20
+ :change_in_cash,
21
+ :begin_period_cash_flow,
22
+ :end_period_cash_flow,
23
+ :total_cash_from_operating_activities,
24
+ :issuance_of_capital_stock,
25
+ :depreciation,
26
+ :other_cashflows_from_investing_activities,
27
+ :dividends_paid,
28
+ :change_to_inventory,
29
+ :change_to_account_receivables,
30
+ :sale_purchase_of_stock,
31
+ :other_cashflows_from_financing_activities,
32
+ :change_to_netincome,
33
+ :capital_expenditures,
34
+ :change_receivables,
35
+ :cash_flows_other_operating,
36
+ :exchange_rate_changes,
37
+ :cash_and_cash_equivalents_changes,
38
+ :change_in_working_capital,
39
+ :stock_based_compensation,
40
+ :other_non_cash_items,
41
+ :free_cash_flow
42
+
43
+ private
44
+
45
+ def initialize(data)
46
+ @date = data['date']
47
+ @filing_date = data['filing_date']
48
+ @currency_symbol = data['currency_symbol']
49
+ @investments = data['investments']
50
+ @change_to_liabilities = data['changeToLiabilities']
51
+ @total_cashflows_from_investing_activities = data['totalCashflowsFromInvestingActivities']
52
+ @net_borrowings = data['netBorrowings']
53
+ @total_cash_from_financing_activities = data['totalCashFromFinancingActivities']
54
+ @change_to_operating_activities = data['changeToOperatingActivities']
55
+ @net_income = data['netIncome']
56
+ @change_in_cash = data['changeInCash']
57
+ @begin_period_cash_flow = data['beginPeriodCashFlow']
58
+ @end_period_cash_flow = data['endPeriodCashFlow']
59
+ @total_cash_from_operating_activities = data['totalCashFromOperatingActivities']
60
+ @issuance_of_capital_stock = data['issuanceOfCapitalStock']
61
+ @depreciation = data['depreciation']
62
+ @other_cashflows_from_investing_activities = data['otherCashflowsFromInvestingActivities']
63
+ @dividends_paid = data['dividendsPaid']
64
+ @change_to_inventory = data['changeToInventory']
65
+ @change_to_account_receivables = data['changeToAccountReceivables']
66
+ @sale_purchase_of_stock = data['salePurchaseOfStock']
67
+ @other_cashflows_from_financing_activities = data['otherCashflowsFromFinancingActivities']
68
+ @change_to_netincome = data['changeToNetincome']
69
+ @capital_expenditures = data['capitalExpenditures']
70
+ @change_receivables = data['changeReceivables']
71
+ @cash_flows_other_operating = data['cashFlowsOtherOperating']
72
+ @exchange_rate_changes = data['exchangeRateChanges']
73
+ @cash_and_cash_equivalents_changes = data['cashAndCashEquivalentsChanges']
74
+ @change_in_working_capital = data['changeInWorkingCapital']
75
+ @stock_based_compensation = data['stockBasedCompensation']
76
+ @other_non_cash_items = data['otherNonCashItems']
77
+ @free_cash_flow = data['freeCashFlow']
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,28 @@
1
+ # Eodhd/Fundamentals/Financials/CashFlow.rb
2
+ # Eodhd::Fundamentals::Financials::CashFlow
3
+
4
+ require_relative './CashFlow/Entry'
5
+
6
+ class Eodhd
7
+ class Fundamentals
8
+ class Financials
9
+ class CashFlow
10
+ attr_reader\
11
+ :quarterly,
12
+ :yearly
13
+
14
+ private
15
+
16
+ def initialize(data)
17
+ @yearly = wrap(data['yearly'])
18
+ @quarterly = wrap(data['quarterly'])
19
+ end
20
+
21
+ def wrap(entries)
22
+ return [] unless entries
23
+ entries.values.map{|entry| Entry.new(entry)}.sort_by(&:date)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end