finmodeling 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/.gitignore +3 -0
  2. data/Gemfile +10 -0
  3. data/README.md +292 -0
  4. data/Rakefile +6 -0
  5. data/TODO.txt +36 -0
  6. data/examples/dump_report.rb +33 -0
  7. data/examples/lists/nasdaq-mid-to-mega-tech-symbols.txt +226 -0
  8. data/examples/show_report.rb +218 -0
  9. data/examples/show_reports.rb +77 -0
  10. data/finmodeling.gemspec +31 -0
  11. data/lib/finmodeling/annual_report_filing.rb +104 -0
  12. data/lib/finmodeling/array_with_stats.rb +22 -0
  13. data/lib/finmodeling/assets_calculation.rb +36 -0
  14. data/lib/finmodeling/assets_item.rb +14 -0
  15. data/lib/finmodeling/assets_item_vectors.rb +638 -0
  16. data/lib/finmodeling/balance_sheet_analyses.rb +33 -0
  17. data/lib/finmodeling/balance_sheet_calculation.rb +68 -0
  18. data/lib/finmodeling/calculation_summary.rb +148 -0
  19. data/lib/finmodeling/can_cache_classifications.rb +36 -0
  20. data/lib/finmodeling/can_cache_summaries.rb +16 -0
  21. data/lib/finmodeling/can_classify_rows.rb +54 -0
  22. data/lib/finmodeling/cash_change_calculation.rb +67 -0
  23. data/lib/finmodeling/cash_change_item.rb +14 -0
  24. data/lib/finmodeling/cash_change_item_vectors.rb +241 -0
  25. data/lib/finmodeling/cash_flow_statement_calculation.rb +85 -0
  26. data/lib/finmodeling/classifiers.rb +11 -0
  27. data/lib/finmodeling/company.rb +102 -0
  28. data/lib/finmodeling/company_filing.rb +64 -0
  29. data/lib/finmodeling/company_filing_calculation.rb +75 -0
  30. data/lib/finmodeling/company_filings.rb +100 -0
  31. data/lib/finmodeling/config.rb +37 -0
  32. data/lib/finmodeling/constant_forecasting_policy.rb +23 -0
  33. data/lib/finmodeling/factory.rb +27 -0
  34. data/lib/finmodeling/float_helpers.rb +17 -0
  35. data/lib/finmodeling/forecasts.rb +48 -0
  36. data/lib/finmodeling/generic_forecasting_policy.rb +19 -0
  37. data/lib/finmodeling/has_string_classifer.rb +96 -0
  38. data/lib/finmodeling/income_statement_analyses.rb +74 -0
  39. data/lib/finmodeling/income_statement_calculation.rb +71 -0
  40. data/lib/finmodeling/income_statement_item.rb +14 -0
  41. data/lib/finmodeling/income_statement_item_vectors.rb +654 -0
  42. data/lib/finmodeling/liabs_and_equity_calculation.rb +36 -0
  43. data/lib/finmodeling/liabs_and_equity_item.rb +14 -0
  44. data/lib/finmodeling/liabs_and_equity_item_vectors.rb +1936 -0
  45. data/lib/finmodeling/net_income_calculation.rb +41 -0
  46. data/lib/finmodeling/paths.rb +5 -0
  47. data/lib/finmodeling/period_array.rb +24 -0
  48. data/lib/finmodeling/quarterly_report_filing.rb +23 -0
  49. data/lib/finmodeling/rate.rb +20 -0
  50. data/lib/finmodeling/ratio.rb +20 -0
  51. data/lib/finmodeling/reformulated_balance_sheet.rb +176 -0
  52. data/lib/finmodeling/reformulated_cash_flow_statement.rb +140 -0
  53. data/lib/finmodeling/reformulated_income_statement.rb +436 -0
  54. data/lib/finmodeling/string_helpers.rb +26 -0
  55. data/lib/finmodeling/version.rb +3 -0
  56. data/lib/finmodeling.rb +70 -0
  57. data/spec/annual_report_filing_spec.rb +68 -0
  58. data/spec/assets_calculation_spec.rb +21 -0
  59. data/spec/assets_item_spec.rb +66 -0
  60. data/spec/balance_sheet_analyses_spec.rb +43 -0
  61. data/spec/balance_sheet_calculation_spec.rb +91 -0
  62. data/spec/calculation_summary_spec.rb +63 -0
  63. data/spec/can_classify_rows_spec.rb +86 -0
  64. data/spec/cash_change_calculation_spec.rb +56 -0
  65. data/spec/cash_change_item_spec.rb +66 -0
  66. data/spec/cash_flow_statement_calculation_spec.rb +108 -0
  67. data/spec/company_filing_calculation_spec.rb +74 -0
  68. data/spec/company_filing_spec.rb +30 -0
  69. data/spec/company_filings_spec.rb +55 -0
  70. data/spec/company_spec.rb +73 -0
  71. data/spec/constant_forecasting_policy_spec.rb +37 -0
  72. data/spec/factory_spec.rb +18 -0
  73. data/spec/forecasts_spec.rb +21 -0
  74. data/spec/generic_forecasting_policy_spec.rb +33 -0
  75. data/spec/income_statement_analyses_spec.rb +63 -0
  76. data/spec/income_statement_calculation_spec.rb +88 -0
  77. data/spec/income_statement_item_spec.rb +86 -0
  78. data/spec/liabs_and_equity_calculation_spec.rb +20 -0
  79. data/spec/liabs_and_equity_item_spec.rb +66 -0
  80. data/spec/mocks/calculation.rb +10 -0
  81. data/spec/mocks/income_statement_analyses.rb +93 -0
  82. data/spec/mocks/sec_query.rb +31 -0
  83. data/spec/net_income_calculation_spec.rb +23 -0
  84. data/spec/period_array.rb +52 -0
  85. data/spec/quarterly_report_filing_spec.rb +69 -0
  86. data/spec/rate_spec.rb +33 -0
  87. data/spec/ratio_spec.rb +33 -0
  88. data/spec/reformulated_balance_sheet_spec.rb +146 -0
  89. data/spec/reformulated_cash_flow_statement_spec.rb +174 -0
  90. data/spec/reformulated_income_statement_spec.rb +293 -0
  91. data/spec/spec_helper.rb +5 -0
  92. data/spec/string_helpers_spec.rb +23 -0
  93. data/tools/create_balance_sheet_training_vectors.rb +65 -0
  94. data/tools/create_cash_change_training_vectors.rb +48 -0
  95. data/tools/create_credit_debit_training_vectors.rb +51 -0
  96. data/tools/create_income_statement_training_vectors.rb +48 -0
  97. metadata +289 -0
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ *swp
2
+ pkg/
3
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "xbrlware-ruby19", :git => "git://github.com/jimlindstrom/xbrlware-ruby19.git"
4
+ #gem "xbrlware-ruby19", :path => "/home/lindstro/code/xbrlware-ruby19/"
5
+
6
+ gem "xbrlware-extras", :git => "git://github.com/jimlindstrom/xbrlware-extras.git"
7
+ #gem "xbrlware-extras", :path => "/home/lindstro/code/xbrlware-extras/"
8
+
9
+ # Specify your gem's dependencies in finmodeling.gemspec
10
+ gemspec
data/README.md ADDED
@@ -0,0 +1,292 @@
1
+ ## Overview
2
+
3
+ FinModeling is a set of tools for manipulating financial data from SEC Edgar (in [XBRL](http://en.wikipedia.org/wiki/XBRL) format).
4
+
5
+ ## Features
6
+
7
+ - Pulls annual (10-k) and quarterly (10-q) financial reports from SEC
8
+ - Uses Naive Bayes Classifiers to classify financial statement items
9
+ - trained on medium-to-large NASDAQ tech companies
10
+ - Reformulates GAAP statements to better highlight enterprise value
11
+ - Generates forecasts based on analysis of historical performance
12
+
13
+ ## Example 1: Forecasting Oracle's Financials Based
14
+
15
+ After running "rake install" (to build and install the 'finmodeling' gem), you can run:
16
+
17
+ lindstro@lindstro-laptop:~/code/finmodels$ ./examples/show_reports.rb --num-forecasts 2 orcl 2011-02-01
18
+ Forecasting 2 periods
19
+ company name: ORACLE CORP
20
+
21
+ 2011-02-28 2011-05-31 2011-08-31 2011-11-30 2012-02-29E 2012-05-29E
22
+ NOA ($MM) 28,172.0 28,282.0 25,235.0 27,055.0 27,342.0 29,107.0
23
+ NFA ($MM) 8,445.0 11,494.0 15,657.0 14,865.0 16,899.0 17,593.0
24
+ CSE ($MM) 36,617.0 39,776.0 40,892.0 41,920.0 44,241.0 46,700.0
25
+ Composition Ratio 3.3359 2.4605 1.6117 1.8200 1.6179 1.6545
26
+ NOA Growth 0.0155 -0.3638 0.3222 0.0431 0.2888
27
+ CSE Growth 0.3886 0.1160 0.1047 0.2412 0.2452
28
+
29
+ NOA growth: a:-0.1619, b:0.1533, r:0.4461, var:0.0787
30
+
31
+ 2011-02-28 2011-05-31 2011-08-31 2011-11-30 2012-02-29E 2012-05-29E
32
+ Revenue ($MM) 8,764.0 10,775.0 8,374.0 8,792.0 9,360.0 9,964.0
33
+ Core OI ($MM) 2,318.0 3,413.0 2,056.0 2,327.0 2,483.0 2,644.0
34
+ OI ($MM) 2,238.0 3,332.0 1,978.0 2,290.0
35
+ FI ($MM) -122.0 -123.0 -138.0 -98.0 -163.0 -185.0
36
+ NI ($MM) 2,116.0 3,209.0 1,840.0 2,192.0 2,321.0 2,459.0
37
+ Gross Margin 0.5858 0.6040 0.5679 0.5845
38
+ Sales PM 0.2644 0.3167 0.2454 0.2646 0.2653 0.2653
39
+ Operating PM 0.2553 0.3092 0.2361 0.2604
40
+ FI / Sales -0.0139 -0.0114 -0.0164 -0.0111 -0.0173 -0.0185
41
+ NI / Sales 0.2414 0.2978 0.2197 0.2493 0.2479 0.2467
42
+ Sales / NOA 1.5298 1.1843 1.3936 1.3837 1.4576
43
+ FI / NFA -0.0581 -0.0479 -0.0250 -0.0437 -0.0437
44
+ Revenue Growth 1.2695 -0.6321 0.2157 0.2852 0.2888
45
+ Core OI Growth 3.6455 -0.8661 0.6443 0.2974 0.2888
46
+ OI Growth 3.8474 -0.8737 0.8006
47
+ ReOI ($MM) 2,647.0 1,290.0 1,683.0 1,833.0 1,993.0
48
+
49
+ operating pm: a:0.2739, b:-0.0057, r:-0.2398, var:0.0007
50
+ asset turnover: a:1.4374, b:-0.0681, r:-0.3914, var:0.0201
51
+ revenue growth: a:0.8112, b:-0.5268, r:-0.5530, var:0.6050
52
+ fi / nfa: a:-0.0602, b:0.0165, r:0.9765, var:0.0001
53
+
54
+ Unknown... 2011-05-31 2011-08-31 2011-11-30
55
+ C ($MM) -17.0 5,421.0 1,255.0
56
+ I ($MM) -8,380.0 -13,091.0 -9,191.0
57
+ d ($MM) 8,688.0 8,568.0 8,956.0
58
+ F ($MM) -291.0 -898.0 -1,020.0
59
+ FCF ($MM) -8,397.0 -7,670.0 -7,936.0
60
+ NI / C -188.7647 0.3394 1.7466
61
+
62
+ ## Example 2: A Summary of Adobe's Filings Since 2010-11-01
63
+
64
+ lindstro@lindstro-laptop:~/code/finmodels$ ./examples/show_reports.rb adbe 2010-11-01
65
+ company name: ADOBE SYSTEMS INC
66
+
67
+ 2010-12-03 2011-03-04 2011-06-03 2011-09-02 2011-12-02
68
+ NOA (000's) 4,269,074.0 4,374,531.0 4,334,056.0 4,428,947.0 4,458,509.0
69
+ NFA (000's) 923,313.0 1,050,876.0 1,055,359.0 1,135,011.0 1,324,604.0
70
+ CSE (000's) 5,192,387.0 5,425,407.0 5,389,415.0 5,563,958.0 5,783,113.0
71
+ Composition Ratio 4.6236 4.1627 4.1067 3.9021 3.3659
72
+ NOA Growth 0.1028 -0.0365 0.0907 0.0270
73
+ CSE Growth 0.1925 -0.0263 0.1363 0.1676
74
+
75
+ NOA growth: a:0.0610, b:-0.0100, r:-0.2006, var:0.0031
76
+
77
+ Unknown... 2011-03-04 2011-06-03 2011-09-02 2011-12-02
78
+ Revenue (000's) 1,027,706.0 1,023,179.0 1,013,212.0 1,152,161.0
79
+ Core OI (000's) 251,831.0 247,172.0 215,630.0 251,253.0
80
+ OI (000's) 245,152.0 240,798.0 206,405.0 182,137.0
81
+ FI (000's) -10,561.0 -11,362.0 -11,304.0 -8,418.0
82
+ NI (000's) 234,591.0 229,436.0 195,101.0 173,719.0
83
+ Gross Margin 0.8952 0.8932 0.8967 0.8989
84
+ Sales PM 0.2450 0.2415 0.2128 0.2180
85
+ Operating PM 0.2385 0.2353 0.2037 0.1580
86
+ FI / Sales -0.0102 -0.0111 -0.0111 -0.0073
87
+ NI / Sales 0.2282 0.2242 0.1925 0.1507
88
+ Sales / NOA 0.2338 0.2337 0.2601
89
+ FI / NFA -0.0108 -0.0107 -0.0074
90
+ Revenue Growth -0.0175 -0.0385 0.6744
91
+ Core OI Growth -0.0721 -0.4216 0.8464
92
+ OI Growth -0.0693 -0.4610 -0.3944
93
+ ReOI (000's) 135,604.0 102,185.0 75,635.0
94
+
95
+ operating pm: a:0.2498, b:-0.0273, r:-0.9434, var:0.0010
96
+ asset turnover: a:0.2294, b:0.0131, r:0.8641, var:0.0001
97
+ revenue growth: a:-0.1398, b:0.3459, r:0.8528, var:0.1097
98
+
99
+ Unknown... 2011-03-04 2011-06-03 2011-09-02 2011-12-02
100
+ C (000's) 332,102.0 397,743.0 320,434.0 334,399.0
101
+ I (000's) -226,787.0 -229,749.0 -391,441.0 -385,261.0
102
+ d (000's) -20,966.0 196,511.0 164,509.0 48,818.0
103
+ F (000's) -84,349.0 -364,505.0 -93,502.0 2,044.0
104
+ FCF (000's) 105,315.0 167,994.0 -71,007.0 -50,862.0
105
+ NI / C 0.7063 0.5768 0.6088 0.5194
106
+
107
+ ## Example 3: A Detailed View of Adobe's Second-to-Last 10-Q
108
+
109
+ lindstro@lindstro-laptop:~/code/finmodels$ ./examples/show_report.rb adbe 10-q -2
110
+ company name: ADOBE SYSTEMS INC
111
+ url: http://www.sec.gov/Archives/edgar/data/796343/000079634311000006/0000796343-11-000006-index.htm
112
+ Balance Sheet (2011-03-04)
113
+ Assets (loc_Assets_1)
114
+ [fa] Cash And Cash Equivalents At Carrying Value 900,156,000.0
115
+ [fa] Short Term Investments 1,736,679,000.0
116
+ [oa] Accounts Receivable Net Current 533,353,000.0
117
+ [fa] Deferred Tax Assets Net Current 66,928,000.0
118
+ [oa] Prepaid Expenses Other Assets 113,682,000.0
119
+ [oa] Property Plant And Equipment Net 453,497,000.0
120
+ [oa] Goodwill 3,686,073,000.0
121
+ [oa] Finite Lived Intangible Assets Net 447,616,000.0
122
+ [fa] Investment In Lease Receivable 207,239,000.0
123
+ [oa] Other Assets Noncurrent 164,801,000.0
124
+ Total 8,310,024,000.0
125
+
126
+ Liabilities and Stockholders' Equity (loc_LiabilitiesAndStockholdersEquity_1)
127
+ [ol] Accrued Restructuring Current 6,759,000.0
128
+ [fl] Accrued Income Taxes Current 57,096,000.0
129
+ [ol] Capital Lease Obligations Current 8,900,000.0
130
+ [ol] Accrued Liabilities Current 458,463,000.0
131
+ [ol] Accounts Payable Current 54,742,000.0
132
+ [ol] Deferred Revenue Current 399,572,000.0
133
+ [fl] Long Term Debt And Capital Lease Obligations 1,511,553,000.0
134
+ [ol] Deferred Revenue Noncurrent 43,826,000.0
135
+ [ol] Accrued Restructuring Noncurrent 7,307,000.0
136
+ [fl] Liability For Uncertain Tax Positions Noncurrent 170,721,000.0
137
+ [fl] Deferred Tax Liabilities Noncurrent 120,756,000.0
138
+ [ol] Other Liabilities Noncurrent 44,922,000.0
139
+ [cse] Treasury Stock Value -3,178,769,000.0
140
+ [cse] Accumulated Other Comprehensive Income Loss Net Of Tax 28,695,000.0
141
+ [cse] Retained Earnings Accumulated Deficit 6,045,631,000.0
142
+ [cse] Additional Paid In Capital 2,529,789,000.0
143
+ [cse] Common Stock Value 61,000.0
144
+ [fl] Preferred Stock Value 0.0
145
+ Total 8,310,024,000.0
146
+
147
+ Net Operational Assets
148
+ OA 5,399,022,000.0
149
+ OL -1,024,491,000.0
150
+ Total 4,374,531,000.0
151
+
152
+ Net Financial Assets
153
+ FA 2,911,002,000.0
154
+ FL -1,860,126,000.0
155
+ Total 1,050,876,000.0
156
+
157
+ Common Shareholders' Equity
158
+ NOA 4,374,531,000.0
159
+ NFA 1,050,876,000.0
160
+ Total 5,425,407,000.0
161
+
162
+ Income Statement (2010-12-04 to 2011-03-04)
163
+ Net Income (Loss) Attributable to Parent (loc_NetIncomeLoss_0)
164
+ [or] Sales Revenue Goods Net 842,689,000.0
165
+ [or] Sales Revenue Services Net 78,846,000.0
166
+ [or] Subscription Revenue 106,171,000.0
167
+ [cogs] Cost Of Goods Sold -30,717,000.0
168
+ [cogs] Cost Of Services -29,044,000.0
169
+ [cogs] Cost Of Goods Sold Subscription -47,878,000.0
170
+ [oe] Research And Development Expense Software Excluding ... -178,400,000.0
171
+ [oe] Selling And Marketing Expense -328,078,000.0
172
+ [oe] General And Administrative Expense -100,979,000.0
173
+ [oibt] Restructuring Charges -41,000.0
174
+ [oibt] Amortization Of Intangible Assets -10,235,000.0
175
+ [fibt] Other Nonoperating Income -817,000.0
176
+ [fibt] Interest Expense -17,020,000.0
177
+ [fibt] Gain Loss On Investments 1,590,000.0
178
+ [tax] Income Tax Expense Benefit -51,496,000.0
179
+ Total 234,591,000.0
180
+
181
+ Gross Revenue
182
+ Operating Revenues (OR) 1,027,706,000.0
183
+ Cost of Goods Sold (COGS) -107,639,000.0
184
+ Total 920,067,000.0
185
+
186
+ Operating Income from sales, before tax (OISBT)
187
+ Gross Margin (GM) 920,067,000.0
188
+ Operating Expense (OE) -607,457,000.0
189
+ Total 312,610,000.0
190
+
191
+ Operating Income from sales, after tax (OISAT)
192
+ Operating income from sales (before tax) 312,610,000.0
193
+ Reported taxes -51,496,000.0
194
+ Taxes on net financing income -5,686,450.0
195
+ Taxes on other operating income -3,596,600.0
196
+ Total 251,830,950.0
197
+
198
+ Operating income, after tax (OI)
199
+ Operating income after sales, after tax (OISAT) 251,830,950.0
200
+ Other operating income, before tax (OIBT) -10,276,000.0
201
+ Tax on other operating income 3,596,600.0
202
+ Other operating income, after tax (OOIAT) 0.0
203
+ Total 245,151,550.0
204
+
205
+ Net financing income, after tax (NFI)
206
+ Financing income, before tax (FIBT) -16,247,000.0
207
+ Tax effect (FIBT_TAX_EFFECT) 5,686,450.0
208
+ Financing income, after tax (FIAT) 0.0
209
+ Total -10,560,550.0
210
+
211
+ Comprehensive (CI)
212
+ Operating income, after tax (OI) 245,151,550.0
213
+ Net financing income, after tax (NFI) -10,560,550.0
214
+ Total 234,591,000.0
215
+
216
+ Cash Flow Statement (2010-12-04 to 2011-03-04)
217
+ Cash and Cash Equivalents, Period Increase (Decrease) (loc_CashAndCashEquivalentsPeriodIncreaseDecrease_2)
218
+ [c] Adjustments Noncash Items To Reconcile Net Income Los... 2,703,000.0
219
+ [c] Net Income Loss 234,591,000.0
220
+ [c] Depreciation And Amortization 66,286,000.0
221
+ [c] Share Based Compensation 70,992,000.0
222
+ [c] Deferred Income Taxes And Tax Credits 28,645,000.0
223
+ [c] Unrealized Gain Loss On Investments -1,330,000.0
224
+ [c] Increase Decrease In Receivables 20,605,000.0
225
+ [c] Increase Decrease In Prepaid Deferred Expense And Oth... -2,716,000.0
226
+ [c] Increase Decrease In Accounts Payable 2,310,000.0
227
+ [c] Increase Decrease In Accrued Liabilities -110,084,000.0
228
+ [c] Other Increase Decrease In Provision For Restructuring -2,526,000.0
229
+ [c] Increase Decrease In Accrued Income Taxes Payable 8,905,000.0
230
+ [c] Increase Decrease In Deferred Revenue 13,721,000.0
231
+ [d] Purchases Long Term Investments Other Assets -5,389,000.0
232
+ [i] Payments To Acquire Short Term Investments -375,077,000.0
233
+ [d] Proceeds From Maturities Of Short Term Investments 134,296,000.0
234
+ [i] Proceeds From Sale Of Short Term Investments 217,407,000.0
235
+ [i] Payments To Acquire Property Plant And Equipment -32,421,000.0
236
+ [i] Payments To Acquire Businesses Net Of Cash Acquired -36,572,000.0
237
+ [d] Proceeds From Sale Of Available For Sale Securities E... 2,755,000.0
238
+ [i] Payments For Proceeds From Other Investing Activities -124,000.0
239
+ [f] Payments For Repurchase Of Common Stock -125,000,000.0
240
+ [f] Proceeds From Sale Of Treasury Stock 40,651,000.0
241
+ [d] Repayments Of Long Term Debt And Capital Securities -2,169,000.0
242
+ [d] Effect Of Exchange Rate On Cash And Cash Equivalents -194,000.0
243
+ Total 150,265,000.0
244
+
245
+ Cash from operations
246
+ [c] Adjustments Noncash Items To Reconcile Net Income Los... 2,703,000.0
247
+ [c] Net Income Loss 234,591,000.0
248
+ [c] Depreciation And Amortization 66,286,000.0
249
+ [c] Share Based Compensation 70,992,000.0
250
+ [c] Deferred Income Taxes And Tax Credits 28,645,000.0
251
+ [c] Unrealized Gain Loss On Investments -1,330,000.0
252
+ [c] Increase Decrease In Receivables 20,605,000.0
253
+ [c] Increase Decrease In Prepaid Deferred Expense And Oth... -2,716,000.0
254
+ [c] Increase Decrease In Accounts Payable 2,310,000.0
255
+ [c] Increase Decrease In Accrued Liabilities -110,084,000.0
256
+ [c] Other Increase Decrease In Provision For Restructuring -2,526,000.0
257
+ [c] Increase Decrease In Accrued Income Taxes Payable 8,905,000.0
258
+ [c] Increase Decrease In Deferred Revenue 13,721,000.0
259
+ Total 332,102,000.0
260
+
261
+ Cash investments in operations
262
+ [i] Payments To Acquire Short Term Investments -375,077,000.0
263
+ [i] Proceeds From Sale Of Short Term Investments 217,407,000.0
264
+ [i] Payments To Acquire Property Plant And Equipment -32,421,000.0
265
+ [i] Payments To Acquire Businesses Net Of Cash Acquired -36,572,000.0
266
+ [i] Payments For Proceeds From Other Investing Activities -124,000.0
267
+ Total -226,787,000.0
268
+
269
+ Payments to debtholders
270
+ [d] Purchases Long Term Investments Other Assets -5,389,000.0
271
+ [d] Proceeds From Maturities Of Short Term Investments 134,296,000.0
272
+ [d] Proceeds From Sale Of Available For Sale Securities E... 2,755,000.0
273
+ [d] Repayments Of Long Term Debt And Capital Securities -2,169,000.0
274
+ [d] Effect Of Exchange Rate On Cash And Cash Equivalents -194,000.0
275
+ [d] Investment in Cash and Equivalents -150,265,000.0
276
+ Total -20,966,000.0
277
+
278
+ Payments to stockholders
279
+ [f] Payments For Repurchase Of Common Stock -125,000,000.0
280
+ [f] Proceeds From Sale Of Treasury Stock 40,651,000.0
281
+ Total -84,349,000.0
282
+
283
+ Free Cash Flow
284
+ Cash from Operations (C) 332,102,000.0
285
+ Cash Investment in Operations (I) -226,787,000.0
286
+ Total 105,315,000.0
287
+
288
+ Financing Flows
289
+ Payments to debtholders (d) -20,966,000.0
290
+ Payments to stockholders (F) -84,349,000.0
291
+ Total -105,315,000.0
292
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+
4
+ task :test do
5
+ sh "rspec -c -fd -I. -Ispec spec/*spec.rb"
6
+ end
data/TODO.txt ADDED
@@ -0,0 +1,36 @@
1
+ Statement of Shareholder Equity
2
+ - Parse this one to get at comprehensive income
3
+
4
+ Forecasts
5
+ - Choosing of policies should probably be bumped to a higher-level package.
6
+ - Need more sophisticated forecasting policies
7
+ - Need to have more sophisticated policies fall back on simpler ones (or none) when there's
8
+ too much chaos
9
+
10
+ Bugs
11
+ - Not all disclosures *begin* with disclosure. See CRM's most recent 10-K, for instance.
12
+ - The "valid vals" thing should hides gaps in data, which silently&crappily affect the regressions.
13
+ - show_reports doesn't check filing validity
14
+
15
+ Income Statement
16
+ - Dig into the disclosures. They've got lots more interesting goodness.
17
+ - It'd be interesting to try to correct for cyclicality.
18
+ - The classifier that had been classifying unknown credits/debits is disabled. Replace it?
19
+ - net income != comprehensive income. pull in items from SSE
20
+ - certain things are being misclassified as FIBT instead of OOIBT. (hedging,
21
+ currency exchg, etc)
22
+ - naming consistency (e.g., rename OIBT as OOIBT?)
23
+ - consistency between operating/financing vs. operational/financial?
24
+ - need to better understand minority interest, noncontrollable blah-blah,
25
+ etc.
26
+
27
+ Balance Sheet
28
+ - Dig into the disclosures. They've got lots more interesting goodness.
29
+ - The classifier that had been classifying unknown credits/debits is disabled. Replace it?
30
+
31
+ Cash Flow Statement
32
+ - Dig into the disclosures. They've got lots more interesting goodness.
33
+ - not taking into account: net cash interest, tax on net interest, or non-cash
34
+ transactions. All 3 of these items are listed in supplementary disclosures.
35
+ - the classifier's success rate isn't that high.
36
+ - "I" is defined inversely.
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'finmodeling'
4
+
5
+ if ARGV.length != 1
6
+ puts "usage #{__FILE__} <stock symbol>"
7
+ exit
8
+ end
9
+
10
+ filing_url = nil
11
+ if !(ARGV[0] =~ /http/)
12
+ company = FinModeling::Company.find(stock_symbol = ARGV[0])
13
+ if company.nil?
14
+ puts "couldn't find company"
15
+ exit
16
+ elsif company.annual_reports.length == 0
17
+ puts "no annual reports"
18
+ exit
19
+ end
20
+ puts "company name: #{company.name}"
21
+
22
+ filing_url = company.annual_reports.last.link
23
+ puts "url: #{filing_url}"
24
+ else
25
+ filing_url = ARGV[0]
26
+ end
27
+
28
+ FinModeling::Config::disable_caching
29
+ filing = FinModeling::AnnualReportFiling.download(filing_url)
30
+
31
+ filing.print_presentations
32
+
33
+ filing.print_calculations
@@ -0,0 +1,226 @@
1
+ ACCL
2
+ ACIW
3
+ ACOM
4
+ ACXM
5
+ ADBE
6
+ ADP
7
+ ADSK
8
+ ADVS
9
+ ALTR
10
+ AMAT
11
+ AMCC
12
+ AMKR
13
+ ANSS
14
+ APKT
15
+ ARBA
16
+ ARRS
17
+ ARUN
18
+ ASGN
19
+ ATML
20
+ ATVI
21
+ AWAY
22
+ AZPN
23
+ BBOX
24
+ BCOV
25
+ BIRT
26
+ BLKB
27
+ BMC
28
+ BRCD
29
+ BRCM
30
+ BRKS
31
+ BSFT
32
+ CA
33
+ CAVM
34
+ CCMP
35
+ CCOI
36
+ CDNS
37
+ CERN
38
+ CEVA
39
+ CMTL
40
+ CNQR
41
+ CPSI
42
+ CPWR
43
+ CREE
44
+ CRUS
45
+ CSCO
46
+ CSGS
47
+ CSOD
48
+ CTCT
49
+ CTSH
50
+ CTXS
51
+ CVLT
52
+ CY
53
+ CYMI
54
+ DELL
55
+ DGII
56
+ DIOD
57
+ DRIV
58
+ DSGX
59
+ EA
60
+ EBIX
61
+ EFII
62
+ ELNK
63
+ ELRC
64
+ ENTR
65
+ EPAY
66
+ EPIQ
67
+ EXAR
68
+ EXTR
69
+ FFIV
70
+ FIRE
71
+ FISV
72
+ FNSR
73
+ FSLR
74
+ FTNT
75
+ GCOM
76
+ GOOG
77
+ GRPN
78
+ GTAT
79
+ HITT
80
+ HLIT
81
+ HSII
82
+ HSTM
83
+ IDTI
84
+ IGTE
85
+ INAP
86
+ INFA
87
+ ININ
88
+ INSP
89
+ INTC
90
+ INTU
91
+ IPGP
92
+ ISIL
93
+ IXYS
94
+ JCOM
95
+ JDAS
96
+ JDSU
97
+ JIVE
98
+ JKHY
99
+ KELYA
100
+ KFRC
101
+ LAMR
102
+ LECO
103
+ LLTC
104
+ LOGI
105
+ LOGM
106
+ LORL
107
+ LPSN
108
+ LRCX
109
+ LSCC
110
+ LUFK
111
+ MANH
112
+ MCHP
113
+ MCRL
114
+ MCRS
115
+ MDAS
116
+ MDCA
117
+ MDRX
118
+ MDSO
119
+ MENT
120
+ MFLX
121
+ MGRC
122
+ MIDD
123
+ MIND
124
+ MIPS
125
+ MKTG
126
+ MLNX
127
+ MODL
128
+ MPWR
129
+ MRGE
130
+ MSCC
131
+ MSTR
132
+ MU
133
+ MXIM
134
+ NATI
135
+ NTAP
136
+ NTCT
137
+ NUAN
138
+ NVDA
139
+ NVLS
140
+ OMCL
141
+ ONNN
142
+ OPNT
143
+ ORCL
144
+ OSIS
145
+ OTEX
146
+ OVTI
147
+ PEGA
148
+ PLAB
149
+ PLXS
150
+ PMCS
151
+ PMTC
152
+ POWI
153
+ PRFT
154
+ PRGS
155
+ PROJ
156
+ QCOM
157
+ QLGC
158
+ QLIK
159
+ QSFT
160
+ QSII
161
+ RCII
162
+ RFMD
163
+ RMBS
164
+ RNWK
165
+ RP
166
+ RVBD
167
+ SABA
168
+ SANM
169
+ SAPE
170
+ SATS
171
+ SCSC
172
+ SGI
173
+ SGMS
174
+ SLAB
175
+ SMCI
176
+ SMSC
177
+ SMTC
178
+ SNCR
179
+ SNDK
180
+ SNPS
181
+ SONS
182
+ SPSC
183
+ SPWR
184
+ SQI
185
+ SSNC
186
+ SSYS
187
+ STEC
188
+ SWKS
189
+ SYKE
190
+ SYMC
191
+ SYNA
192
+ SYNT
193
+ TECD
194
+ TIBX
195
+ TLEO
196
+ TNGO
197
+ TQNT
198
+ TRAK
199
+ TRIP
200
+ TSRA
201
+ TTEC
202
+ TTMI
203
+ TTWO
204
+ TWIN
205
+ TXN
206
+ TYPE
207
+ TZOO
208
+ UBNT
209
+ ULTI
210
+ UNTD
211
+ UTEK
212
+ VCLK
213
+ VDSI
214
+ VECO
215
+ VIAS
216
+ VLTR
217
+ VRNT
218
+ VRSK
219
+ VRSN
220
+ VRTU
221
+ VSAT
222
+ WWWW
223
+ XLNX
224
+ YHOO
225
+ ZBRA
226
+ ZNGA