-
Notifications
You must be signed in to change notification settings - Fork 4
/
model.py
1089 lines (1052 loc) · 48.5 KB
/
model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from sqlalchemy import Column, Date, String, ForeignKey, Integer, Boolean, UniqueConstraint, Float, BigInteger
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, aliased
Base = declarative_base()
class Equity(Base):
__tablename__ = 'equity'
id = Column(Integer, primary_key=True)
ticker = Column(String(255), index=True)
name = Column(String(255))
cusip = Column(String(255))
fama_industry = Column(String(255))
currency = Column(String(255))
sector = Column(String(255))
industry = Column(String(255))
last_updated = Column(Date)
prior_tickers = Column(String(255))
ticker_change_date = relationship("TickerChangeDate", backref='equity')
related_tickers = relationship("RelatedTicker", backref='equity')
exchange = Column(String(255))
sic = Column(String(255))
location = Column(String(255))
delisted_from = Column(String(255))
is_foreign = Column(Boolean)
def country(self):
split = self.location.split(',')
country = self.location if len(split) == 1 else split[1]
return country.strip()
class RelatedTicker(Base):
__tablename__ = 'related_ticker'
related_ticker_id = Column(Integer, primary_key=True)
equity_id = Column(Integer, ForeignKey('equity.id'))
ticker = Column(String(255), index=True)
class TickerChangeDate(Base):
__tablename__ = '_ticker_change_date'
ticker_change_date_id = Column(Integer, primary_key=True)
equity_id = Column(Integer, ForeignKey('equity.id'))
date = Column(Date)
class Fundamentals(Base):
__tablename__ = 'fundamentals'
__table_args__ = (UniqueConstraint('symbol', 'date'),)
id = Column(Integer, primary_key=True)
symbol = Column(String(255))
date = Column(Date)
price = Column(Float)
balance_sheet = relationship("BalanceSheet", backref="fundamentals", uselist=False)
income_statement = relationship("IncomeStatement", backref="fundamentals", uselist=False)
asset_classification = relationship("AssetClassification", backref="fundamentals", uselist=False)
cash_flow_statement = relationship("CashFlowStatement", backref="fundamentals", uselist=False)
company_reference = relationship("CompanyReference", backref="fundamentals", uselist=False)
earnings_ratios = relationship("EarningsRatios", backref="fundamentals", uselist=False)
earnings_report = relationship("EarningsReport", backref="fundamentals", uselist=False)
financial_statement_filing = relationship("FinancialStatementFiling", backref="fundamentals", uselist=False)
general_profile = relationship("GeneralProfile", backref="fundamentals", uselist=False)
operation_ratios = relationship("OperationRatios", backref="fundamentals", uselist=False)
share_class_reference = relationship("ShareClassReference", backref="fundamentals", uselist=False)
valuation = relationship("Valuation", backref="fundamentals", uselist=False)
valuation_ratios = relationship("ValuationRatios", backref="fundamentals", uselist=False)
class AssetClassification(Base):
__tablename__ = 'asset_classification'
asset_classification_id = Column(Integer, ForeignKey(Fundamentals.id), primary_key=True)
cannaics = Column(Float)
financial_health_grade = Column(Float)
growth_grade = Column(Float)
growth_score = Column(Float)
morningstar_economy_sphere_code = Column(Float)
morningstar_industry_code = Column(String(255))
morningstar_industry_group_code = Column(String(255))
morningstar_sector_code = Column(String(255))
nace = Column(Float)
naics = Column(Float)
profitability_grade = Column(Float)
sic = Column(String(255))
size_score = Column(Float)
stock_type = Column(Float)
style_box = Column(Float)
style_score = Column(Float)
value_score = Column(Float)
last_updated = Column(Date)
class BalanceSheet(Base):
__tablename__ = 'balance_sheet'
balance_sheet_id = Column(Integer, ForeignKey(Fundamentals.id), primary_key=True)
accounts_payable = Column(Float)
accounts_receivable = Column(Float)
accrued_interest_receivable = Column(Float)
accrued_investment_income = Column(Float)
accrued_liabilities_total = Column(Float)
accruedand_deferred_income = Column(Float)
accruedand_deferred_income_current = Column(Float)
accruedand_deferred_income_non_current = Column(Float)
accumulated_depreciation = Column(Float)
additional_paid_in_capital = Column(Float)
advance_from_federal_home_loan_banks = Column(Float)
advancesfrom_central_banks = Column(Float)
allowance_for_doubtful_accounts_receivable = Column(Float)
allowance_for_loans_and_lease_losses = Column(Float)
allowance_for_notes_receivable = Column(Float)
assets_held_for_sale = Column(Float)
assets_of_discontinued_operations = Column(Float)
available_for_sale_securities = Column(Float)
bank_acceptance_executed_and_outstanding = Column(Float)
bank_indebtedness = Column(Float)
bank_loan = Column(Float)
bank_loans_current = Column(Float)
bank_loans_non_current = Column(Float)
bank_loans_total = Column(Float)
bank_owned_life_insurance = Column(Float)
buildings_and_improvements = Column(Float)
capital_lease_obligations = Column(Float)
capital_stock = Column(Float)
cash = Column(Float)
cash_and_cash_equivalents = Column(Float)
cash_and_due_from_banks = Column(Float)
cash_cash_equivalents_and_federal_funds_sold = Column(Float)
cash_cash_equivalents_and_marketable_securities = Column(Float)
cash_equivalents = Column(Float)
cash_value_of_life_insurance = Column(Float)
cashand_balanceswith_central_banks = Column(Float)
casualty_claims = Column(Float)
ceded_unearned_premiums = Column(Float)
claims_outstanding = Column(Float)
com_tre_sha_num = Column(Float)
commercial_loan = Column(Float)
commercial_paper = Column(Float)
common_stock = Column(Float)
common_stock_equity = Column(Float)
common_stocks_available_for_sale = Column(Float)
common_utility_plant = Column(Float)
construction_grants = Column(Float)
construction_in_progress = Column(Float)
consumer_loan = Column(Float)
convertible_loans_current = Column(Float)
current_accrued_expenses = Column(Float)
current_assets = Column(Float)
current_capital_lease_obligation = Column(Float)
current_debt = Column(Float)
current_debt_and_capital_lease_obligation = Column(Float)
current_deferred_assets = Column(Float)
current_deferred_liabilities = Column(Float)
current_deferred_revenue = Column(Float)
current_deferred_taxes_assets = Column(Float)
current_deferred_taxes_liabilities = Column(Float)
current_liabilities = Column(Float)
current_notes_payable = Column(Float)
current_provisions = Column(Float)
customer_acceptances = Column(Float)
customer_accounts = Column(Float)
debt_securities = Column(Float)
debt_securitiesin_issue = Column(Float)
debt_total = Column(Float)
deferred_acquisition_costs = Column(Float)
deferred_assets = Column(Float)
deferred_cost_current = Column(Float)
deferred_costs = Column(Float)
deferred_financing_costs = Column(Float)
deferred_policy_acquisition_costs = Column(Float)
deferred_tax_assets = Column(Float)
deferred_tax_liabilities_total = Column(Float)
defined_pension_benefit = Column(Float)
deposits_madeunder_assumed_reinsurance_contract = Column(Float)
deposits_receivedunder_ceded_insurance_contract = Column(Float)
depositsby_bank = Column(Float)
derivative_assets = Column(Float)
derivative_product_liabilities = Column(Float)
dividends_payable = Column(Float)
electric_utility_plant = Column(Float)
employee_benefits = Column(Float)
equity_attributable_to_owners_of_parent = Column(Float)
equity_investments = Column(Float)
equity_shares_investments = Column(Float)
esop_debt_guarantee = Column(Float)
facilities_and_other = Column(Float)
federal_funds_purchased = Column(Float)
#federal_funds_purchased_and_securities_sold_under_agreement_to_repurchase = Column(Float)
federal_funds_sold = Column(Float)
#federal_funds_sold_and_securities_purchase_under_agreements_to_resell = Column(Float)
federal_home_loan_bank_stock = Column(Float)
finance_lease_receivables_current = Column(Float)
finance_lease_receivables_non_current = Column(Float)
financial_assets = Column(Float)
#financial_assets_designatedas_fair_value_through_profitor_loss_total = Column(Float)
financial_instruments_sold_under_agreements_to_repurchase = Column(Float)
financial_liabilities_current = Column(Float)
#financial_liabilities_designatedas_fair_value_through_profitor_loss_total = Column(Float)
financial_liabilities_measuredat_amortized_cost_total = Column(Float)
financial_liabilities_non_current = Column(Float)
finished_goods = Column(Float)
fixed_maturities_available_for_sale = Column(Float)
fixed_maturities_held_to_maturity = Column(Float)
fixed_maturities_trading = Column(Float)
fixed_maturity_investments = Column(Float)
flight_fleet_vehicle_and_related_equipments = Column(Float)
foreclosed_assets = Column(Float)
foreign_component = Column(Float)
foreign_currency_translation_adjustments = Column(Float)
fuel_and_natural_gas = Column(Float)
future_policy_benefits = Column(Float)
gains_losses_not_affecting_retained_earnings = Column(Float)
general_partnership_capital = Column(Float)
goodwill = Column(Float)
goodwill_and_other_intangible_assets = Column(Float)
gross_accounts_receivable = Column(Float)
gross_loan = Column(Float)
gross_notes_receivable = Column(Float)
gross_ppe = Column(Float)
guaranteed_investment_contract = Column(Float)
hedging_assets_current = Column(Float)
hedging_assets_non_current = Column(Float)
hedging_liabilities_current = Column(Float)
hedging_liabilities_non_current = Column(Float)
held_to_maturity_securities = Column(Float)
income_tax_payable = Column(Float)
insurance_contract_assets = Column(Float)
insurance_contract_liabilities = Column(Float)
insurance_funds_non_current = Column(Float)
insurance_payables = Column(Float)
insurance_receivables = Column(Float)
interest_bearing_borrowings_current = Column(Float)
interest_bearing_borrowings_non_current = Column(Float)
interest_bearing_borrowings_total = Column(Float)
interest_bearing_deposits_assets = Column(Float)
interest_bearing_deposits_liabilities = Column(Float)
interest_payable = Column(Float)
inventories_adjustments_allowances = Column(Float)
inventory = Column(Float)
invested_capital = Column(Float)
investment_contract_liabilities = Column(Float)
investment_properties = Column(Float)
investment_tax_credits = Column(Float)
investmentin_financial_assets = Column(Float)
investments_and_advances = Column(Float)
#investments_in_affiliates_subsidiaries_associates_and_joint_ventures = Column(Float)
investments_in_other_ventures_under_equity_method = Column(Float)
investments_in_variable_interest_entity = Column(Float)
investmentsin_associatesat_cost = Column(Float)
investmentsin_joint_venturesat_cost = Column(Float)
investmentsin_subsidiariesat_cost = Column(Float)
land_and_improvements = Column(Float)
leases = Column(Float)
liabilities_heldfor_sale_current = Column(Float)
liabilities_heldfor_sale_non_current = Column(Float)
liabilities_heldfor_sale_total = Column(Float)
liabilities_of_discontinued_operations = Column(Float)
limited_partnership = Column(Float)
limited_partnership_capital = Column(Float)
line_of_credit = Column(Float)
loan_capital = Column(Float)
loans_held_for_sale = Column(Float)
loans_receivable = Column(Float)
loansand_advancesto_bank = Column(Float)
loansand_advancesto_customer = Column(Float)
long_term_capital_lease_obligation = Column(Float)
long_term_contracts = Column(Float)
long_term_debt = Column(Float)
long_term_debt_and_capital_lease_obligation = Column(Float)
long_term_investments = Column(Float)
long_term_provisions = Column(Float)
machinery_furniture_equipment = Column(Float)
materials_and_supplies = Column(Float)
mineral_properties = Column(Float)
minimum_pension_liabilities = Column(Float)
minority_interest = Column(Float)
money_market_investments = Column(Float)
mortgage_and_consumerloans = Column(Float)
mortgage_loan = Column(Float)
natural_gas_fuel_and_other = Column(Float)
natural_resource_assets = Column(Float)
net_assets = Column(Float)
net_debt = Column(Float)
net_loan = Column(Float)
net_other_unrealized_gain_loss = Column(Float)
net_ppe = Column(Float)
net_tangible_assets = Column(Float)
net_unrealized_gain_loss_foreign_currency = Column(Float)
net_unrealized_gain_loss_investments = Column(Float)
net_utility_plant = Column(Float)
non_current_accounts_receivable = Column(Float)
non_current_accrued_expenses = Column(Float)
non_current_deferred_assets = Column(Float)
non_current_deferred_liabilities = Column(Float)
non_current_deferred_revenue = Column(Float)
non_current_deferred_taxes_assets = Column(Float)
non_current_deferred_taxes_liabilities = Column(Float)
non_current_note_receivables = Column(Float)
non_current_pension_and_other_postretirement_benefit_plans = Column(Float)
non_current_prepaid_assets = Column(Float)
non_interest_bearing_borrowings_current = Column(Float)
non_interest_bearing_borrowings_non_current = Column(Float)
non_interest_bearing_deposits = Column(Float)
notes_receivable = Column(Float)
ordinary_shares_number = Column(Float)
other_assets = Column(Float)
other_capital_stock = Column(Float)
other_current_assets = Column(Float)
other_current_borrowings = Column(Float)
other_current_liabilities = Column(Float)
other_deferred_costs = Column(Float)
other_deposits = Column(Float)
other_equity_adjustments = Column(Float)
other_equity_interest = Column(Float)
other_intangible_assets = Column(Float)
other_interest_earning_assets = Column(Float)
other_inventories = Column(Float)
other_invested_assets = Column(Float)
other_liabilities = Column(Float)
other_loan_assets = Column(Float)
other_loans_current = Column(Float)
other_loans_non_current = Column(Float)
other_loans_total = Column(Float)
other_non_current_assets = Column(Float)
other_non_current_liabilities = Column(Float)
other_payable = Column(Float)
other_properties = Column(Float)
other_real_estate_owned = Column(Float)
other_receivables = Column(Float)
other_reserves = Column(Float)
other_short_term_investments = Column(Float)
participating_policyholder_equity = Column(Float)
patents = Column(Float)
payables = Column(Float)
payables_and_accrued_expenses = Column(Float)
paymentof_bills = Column(Float)
pension_and_other_postretirement_benefit_plans_total = Column(Float)
pensionand_other_post_retirement_benefit_plans_current = Column(Float)
placementwith_banksand_other_financial_institutions = Column(Float)
policy_loans = Column(Float)
policy_reserves_benefits = Column(Float)
policyholder_funds = Column(Float)
pre_tre_sha_num = Column(Float)
preferred_securities_outside_stock_equity = Column(Float)
preferred_shares_number = Column(Float)
preferred_stock = Column(Float)
preferred_stock_equity = Column(Float)
preferred_stock_of_subsidiary = Column(Float)
preferred_stocks_available_for_sale = Column(Float)
premiums_receivable = Column(Float)
prepaid_assets = Column(Float)
prepaid_reinsurance_premiums = Column(Float)
properties = Column(Float)
provisions_total = Column(Float)
purchased_components = Column(Float)
raw_materials = Column(Float)
real_estate = Column(Float)
real_estate_and_real_estate_joint_ventures_held_for_investment = Column(Float)
real_estate_held_for_sale = Column(Float)
receivables = Column(Float)
receivables_adjustments_allowances = Column(Float)
redeemable_preferred_stock = Column(Float)
regulatory_assets = Column(Float)
regulatory_liabilities = Column(Float)
reinsurance_assets = Column(Float)
reinsurance_balances_payable = Column(Float)
reinsurance_receivables = Column(Float)
reinsurance_recoverable = Column(Float)
reinsurance_recoverable_for_paid_losses = Column(Float)
reinsurance_recoverable_for_unpaid_losses = Column(Float)
reinsurance_shareof_insurance_contract = Column(Float)
restricted_cash = Column(Float)
restricted_cash_and_cash_equivalents = Column(Float)
restricted_cash_and_investments = Column(Float)
restricted_common_stock = Column(Float)
restricted_investments = Column(Float)
retained_earnings = Column(Float)
securities_and_investments = Column(Float)
securities_lending_collateral = Column(Float)
securities_lending_payable = Column(Float)
securities_loaned = Column(Float)
security_agree_to_be_resell = Column(Float)
security_borrowed = Column(Float)
security_sold_not_yet_repurchased = Column(Float)
separate_account_assets = Column(Float)
separate_account_business = Column(Float)
share_issued = Column(Float)
short_term_investments_available_for_sale = Column(Float)
short_term_investments_held_to_maturity = Column(Float)
short_term_investments_trading = Column(Float)
stockholders_equity = Column(Float)
student_loan = Column(Float)
subordinated_liabilities = Column(Float)
tangible_book_value = Column(Float)
tax_assets_total = Column(Float)
taxes_assets_current = Column(Float)
taxes_receivable = Column(Float)
time_deposits_placed = Column(Float)
total_assets = Column(Float)
total_capitalization = Column(Float)
total_debt = Column(Float)
total_deferred_credits_and_other_non_current_liabilities = Column(Float)
total_deposits = Column(Float)
total_equity = Column(Float)
total_equity_gross_minority_interest = Column(Float)
total_investments = Column(Float)
total_liabilities = Column(Float)
total_liabilities_net_minority_interest = Column(Float)
total_non_current_assets = Column(Float)
total_non_current_liabilities = Column(Float)
total_non_current_liabilities_net_minority_interest = Column(Float)
total_partnership_capital = Column(Float)
total_tax_payable = Column(Float)
tradeand_other_payables_non_current = Column(Float)
trading_and_other_receivable = Column(Float)
trading_assets = Column(Float)
trading_liabilities = Column(Float)
trading_securities = Column(Float)
tradingand_financial_liabilities = Column(Float)
treasury_shares_number = Column(Float)
treasury_stock = Column(Float)
unbilled_receivables = Column(Float)
unclassified_current_assets = Column(Float)
unearned_income = Column(Float)
unearned_premiums = Column(Float)
unpaid_loss_and_loss_reserve = Column(Float)
unrealized_gain_loss = Column(Float)
water_production = Column(Float)
work_in_process = Column(Float)
working_capital = Column(Float)
last_updated = Column(Date)
class IncomeStatement(Base):
__tablename__ = 'income_statement'
income_statement_id = Column(Integer, ForeignKey(Fundamentals.id), primary_key=True)
accretion_on_preferred_stock = Column(Float)
accrued_preferred_stock_dividends = Column(Float)
acquired_in_process_rn_d = Column(Float)
acquired_in_process_rn_d_income = Column(Float)
acquiredin_process_rn_d_income_banks = Column(Float)
acquisition_expense = Column(Float)
administrative_expense = Column(Float)
agency_fees = Column(Float)
agency_fees_and_commissions = Column(Float)
allowances_for_construction = Column(Float)
amortization = Column(Float)
amortization_of_deferred_acquisition_costs = Column(Float)
amortization_of_intangibles = Column(Float)
average_dilution_earn = Column(Float)
capitaln_business_taxes = Column(Float)
ceded_premiums = Column(Float)
changein_investment_contract = Column(Float)
changesin_inventoriesof_finished_goodsand_workin_progress = Column(Float)
claimsand_paid_incurred = Column(Float)
commission_expenses = Column(Float)
commission_revenue = Column(Float)
cost_of_revenue = Column(Float)
credit_card = Column(Float)
credit_losses_provision = Column(Float)
credit_risk_provisions = Column(Float)
cumulative_effect_of_accounting_change = Column(Float)
depletion = Column(Float)
depreciation = Column(Float)
depreciation_amortization_depletion = Column(Float)
depreciation_and_amortization = Column(Float)
development_expense = Column(Float)
distribution_costs = Column(Float)
dividend_income = Column(Float)
earning_loss_of_equity_investments = Column(Float)
earnings_from_equity_interest = Column(Float)
earningsfrom_equity_interest_net_of_tax = Column(Float)
ebit = Column(Float)
ebitda = Column(Float)
electric_revenue = Column(Float)
equipment = Column(Float)
exceptional_items = Column(Float)
excise_taxes = Column(Float)
exploration_development_and_mineral_property_lease_expenses = Column(Float)
fee_revenue_and_other_income = Column(Float)
fees = Column(Float)
fees_and_commissions = Column(Float)
feesand_commission_expense = Column(Float)
feesand_commission_income = Column(Float)
foreign_exchange_trading_gains = Column(Float)
fuel = Column(Float)
fuel_and_purchase_power = Column(Float)
gain_losson_derecognitionof_available_for_sale_financial_assets = Column(Float)
#gain_losson_derecognitionof_non_current_assets_not_heldfor_sale_total = Column(Float)
gain_losson_financial_instruments_designatedas_cash_flow_hedges = Column(Float)
gain_losson_saleof_assets = Column(Float)
gain_on_sale_of_business = Column(Float)
gain_on_sale_of_ppe = Column(Float)
gain_on_sale_of_security = Column(Float)
gainon_extinguishmentof_debt = Column(Float)
gainon_investment_properties = Column(Float)
gainon_redemptionand_extinguishmentof_debt = Column(Float)
gainon_saleof_investment_property = Column(Float)
gainon_saleof_loans = Column(Float)
gains_loss_on_disposal_of_discontinued_operations = Column(Float)
gas_revenue = Column(Float)
general_account_assets = Column(Float)
general_and_administrative_expense = Column(Float)
general_expense = Column(Float)
gross_dividend_payment = Column(Float)
gross_premiums_written = Column(Float)
gross_profit = Column(Float)
impairment_losses_reversals_financial_instruments_net = Column(Float)
impairment_of_capital_assets = Column(Float)
impairmentof_capital_assets_income = Column(Float)
incomefrom_associatesand_other_participating_interests = Column(Float)
incomefrom_sharesin_subsidiaries_group_undertakings = Column(Float)
increase_decrease_in_net_unearned_premium_reserves = Column(Float)
insurance_and_claims = Column(Float)
insurance_and_premiums = Column(Float)
interest_expense = Column(Float)
interest_expense_for_capitalized_lease_obligations = Column(Float)
interest_expense_for_deposit = Column(Float)
#interest_expense_for_federal_funds_sold_and_securities_purchase_under_agreements_to_resell = Column(Float)
interest_expense_for_long_term_debt = Column(Float)
interest_expense_for_long_term_debt_and_capital_securities = Column(Float)
interest_expense_for_short_term_debt = Column(Float)
interest_expense_non_operating = Column(Float)
interest_expense_operating = Column(Float)
interest_income = Column(Float)
interest_income_after_provision_for_loan_loss = Column(Float)
interest_income_from_deposits = Column(Float)
#interest_income_from_federal_funds_sold_and_securities_purchase_under_agreements_to_resell = Column(Float)
interest_income_from_interest_bearing_deposits = Column(Float)
interest_income_from_investment_securities = Column(Float)
interest_income_from_leases = Column(Float)
interest_income_from_loans = Column(Float)
interest_income_from_loans_and_lease = Column(Float)
interest_income_from_other_money_market_investments = Column(Float)
interest_income_from_securities = Column(Float)
interest_income_from_trading_account_securities = Column(Float)
interest_income_non_operating = Column(Float)
interest_income_operating = Column(Float)
interest_income_other_operating_income = Column(Float)
interestand_similar_income = Column(Float)
investment_banking_profit = Column(Float)
life_annuity_premiums = Column(Float)
loans_held_for_resell = Column(Float)
loss_adjustment_expense = Column(Float)
loss_and_loss_adjustment_expected_incurred = Column(Float)
losson_extinguishmentof_debt = Column(Float)
maintenance_and_repairs = Column(Float)
marketing_expense = Column(Float)
minority_interests = Column(Float)
misc_other_special_charges = Column(Float)
miscellaneous_other_operating_income = Column(Float)
negative_goodwill_immediately_recognized = Column(Float)
net_foreign_exchange_gain_loss = Column(Float)
net_income = Column(Float)
net_income_common_stockholders = Column(Float)
net_income_continuous_operations = Column(Float)
net_income_discontinuous_operations = Column(Float)
net_income_extraordinary = Column(Float)
net_income_from_continuing_and_discontinued_operation = Column(Float)
net_income_from_continuing_operation_net_minority_interest = Column(Float)
net_income_from_other_gains_losses = Column(Float)
net_income_from_tax_loss_carryforward = Column(Float)
net_income_including_noncontrolling_interests = Column(Float)
net_interest_income = Column(Float)
net_investment_income = Column(Float)
net_non_operating_interest_income_expense = Column(Float)
net_occupancy_expense = Column(Float)
net_operating_interest_income_expense = Column(Float)
net_policyholder_benefits_and_claims = Column(Float)
net_premiums_written = Column(Float)
net_realized_gain_loss_on_investments = Column(Float)
non_interest_expense = Column(Float)
non_interest_income = Column(Float)
non_operating_expenses = Column(Float)
non_operating_income = Column(Float)
non_recurring_operation_expense = Column(Float)
normalized_income = Column(Float)
occupancy_and_equipment = Column(Float)
operating_expense = Column(Float)
operating_income = Column(Float)
operating_revenue = Column(Float)
operating_taxesn_licenses = Column(Float)
operation_and_maintenance = Column(Float)
other_customer_services = Column(Float)
other_gain_loss_from_disposition_of_discontinued_operations = Column(Float)
other_impairment_of_capital_assets = Column(Float)
other_income_expense = Column(Float)
other_interest_expense = Column(Float)
other_interest_income = Column(Float)
other_non_interest_expense = Column(Float)
other_non_interest_income = Column(Float)
other_non_operating_expenses = Column(Float)
other_non_operating_income = Column(Float)
other_non_operating_income_expenses = Column(Float)
other_operating_expenses = Column(Float)
other_operating_income_total = Column(Float)
other_operating_revenue = Column(Float)
other_special_charges = Column(Float)
other_staff_costs = Column(Float)
other_taxes = Column(Float)
other_write_down = Column(Float)
other_write_off = Column(Float)
otherunder_preferred_stock_dividend = Column(Float)
pension_costs = Column(Float)
policy_acquisition_expense = Column(Float)
policy_fees = Column(Float)
policyholder_and_reinsurer_accounts = Column(Float)
policyholder_benefits_ceded = Column(Float)
policyholder_benefits_gross = Column(Float)
policyholder_dividends = Column(Float)
policyholder_interest = Column(Float)
preferred_stock_dividends = Column(Float)
premium_taxes_credit = Column(Float)
pretax_income = Column(Float)
principle_investment_gain_loss = Column(Float)
principle_transaction_revenue = Column(Float)
professional_expense_and_contract_services_expense = Column(Float)
promotion_and_advertising = Column(Float)
property_casualty_premiums = Column(Float)
property_liability_insurance_claims = Column(Float)
provision_for_doubtful_accounts = Column(Float)
provision_for_gain_loss_on_disposal = Column(Float)
purchased_transportation_services = Column(Float)
realized_capital_gain = Column(Float)
reconciled_cost_of_revenue = Column(Float)
reconciled_depreciation = Column(Float)
reinsurance_recoveries_claimsand_benefits = Column(Float)
rent_and_landing_fees = Column(Float)
research_and_development = Column(Float)
research_expense = Column(Float)
restructring_and_mn_a_income = Column(Float)
restructuring_and_merger_and_acquisition_income = Column(Float)
restructuring_and_mergern_acquisition = Column(Float)
revenues_cargo = Column(Float)
revenues_passenger = Column(Float)
salaries_and_wages = Column(Float)
securities_activities = Column(Float)
securities_amortization = Column(Float)
selling_and_marketing_expense = Column(Float)
selling_expense = Column(Float)
selling_general_and_administration = Column(Float)
service_charge_on_depositor_accounts = Column(Float)
share_based_payments = Column(Float)
shareof_operating_profit_lossfrom_joint_ventures_and_associates = Column(Float)
social_security_costs = Column(Float)
special_charge = Column(Float)
special_income = Column(Float)
special_income_charges = Column(Float)
staff_costs = Column(Float)
tax_effect_of_unusual_items = Column(Float)
tax_provision = Column(Float)
tax_rate_for_calcs = Column(Float)
time_deposits_placed = Column(Float)
total_expenses = Column(Float)
total_money_market_investments = Column(Float)
total_other_finance_cost = Column(Float)
total_premiums_earned = Column(Float)
total_revenue = Column(Float)
total_unusual_items = Column(Float)
total_unusual_items_excluding_goodwill = Column(Float)
trading_gain_loss = Column(Float)
transportation_revenue = Column(Float)
trust_feesby_commissions = Column(Float)
trust_preferred_securities = Column(Float)
underwriting_expenses = Column(Float)
wagesand_salaries = Column(Float)
work_performedby_entityand_capitalized = Column(Float)
write_down = Column(Float)
write_off = Column(Float)
last_updated = Column(Date)
class CashFlowStatement(Base):
__tablename__ = 'cash_flow_statement'
cash_flow_statement_id = Column(Integer, ForeignKey(Fundamentals.id), primary_key=True)
adjusted_geography_segment_data = Column(Float)
adjustmentsfor_undistributed_profitsof_associates = Column(Float)
allowance_for_funds_construction = Column(Float)
amortization = Column(Float)
amortization_of_financing_costs_and_discounts = Column(Float)
amortization_of_intangibles = Column(Float)
amortization_of_securities = Column(Float)
asset_impairment_charge = Column(Float)
beginning_cash_position = Column(Float)
calls_maturities_of_maturity_securities = Column(Float)
cap_ex_reported = Column(Float)
capital_expenditure = Column(Float)
cash_advancesand_loans_madeto_other_parties = Column(Float)
cash_dividends_paid = Column(Float)
cash_flow_from_continuing_financing_activities = Column(Float)
cash_flow_from_continuing_investing_activities = Column(Float)
cash_flow_from_continuing_operating_activities = Column(Float)
cash_flow_from_discontinued_operation = Column(Float)
cash_flowsfromusedin_operating_activities_direct = Column(Float)
cash_from_discontinued_financing_activities = Column(Float)
cash_from_discontinued_investing_activities = Column(Float)
cash_from_discontinued_operating_activities = Column(Float)
cash_receiptsfrom_paymentsfor_financial_derivative_contracts = Column(Float)
#cash_receiptsfrom_repaymentof_advancesand_loans_madeto_other_parties = Column(Float)
change_in_account_payable = Column(Float)
change_in_accrued_expense = Column(Float)
change_in_accrued_investment_income = Column(Float)
change_in_deferred_acquisition_costs = Column(Float)
change_in_deferred_charges = Column(Float)
change_in_dividend_payable = Column(Float)
change_in_federal_funds_and_securities_sold_for_repurchase = Column(Float)
change_in_funds_withheld = Column(Float)
change_in_income_tax_payable = Column(Float)
change_in_interest_payable = Column(Float)
change_in_inventory = Column(Float)
change_in_loans = Column(Float)
change_in_loss_and_loss_adjustment_expense_reserves = Column(Float)
change_in_other_current_assets = Column(Float)
change_in_other_current_liabilities = Column(Float)
change_in_other_working_capital = Column(Float)
change_in_payable = Column(Float)
change_in_payables_and_accrued_expense = Column(Float)
change_in_premiums_receivable = Column(Float)
change_in_prepaid_assets = Column(Float)
change_in_prepaid_reinsurance_premiums = Column(Float)
change_in_receivables = Column(Float)
change_in_reinsurance_receivable_on_paid_losses = Column(Float)
change_in_reinsurance_recoverable_on_paid_and_unpaid_losses = Column(Float)
change_in_reinsurance_recoverable_on_unpaid_losses = Column(Float)
change_in_restricted_cash = Column(Float)
change_in_tax_payable = Column(Float)
change_in_trading_account_securities = Column(Float)
change_in_unearned_premiums = Column(Float)
change_in_unearned_premiums_ceded = Column(Float)
change_in_working_capital = Column(Float)
changein_accrued_income = Column(Float)
changein_deferred_income = Column(Float)
changein_insurance_contract_assets = Column(Float)
changein_reinsurance_receivables = Column(Float)
changes_in_account_receivables = Column(Float)
changes_in_cash = Column(Float)
classesof_cash_payments = Column(Float)
classesof_cash_receiptsfrom_operating_activities = Column(Float)
common_stock_dividend_paid = Column(Float)
common_stock_issuance = Column(Float)
common_stock_payments = Column(Float)
cumulative_effect_of_accounting_change = Column(Float)
decreasein_interest_bearing_depositsin_bank = Column(Float)
deferred_income_tax = Column(Float)
deferred_tax = Column(Float)
depletion = Column(Float)
depreciation = Column(Float)
depreciation_amortization_depletion = Column(Float)
depreciation_and_amortization = Column(Float)
dividend_paid_cfo = Column(Float)
dividend_received_cfo = Column(Float)
dividends_paid_direct = Column(Float)
dividends_received_cfi = Column(Float)
dividends_received_direct = Column(Float)
domestic_sales = Column(Float)
earnings_losses_from_equity_investments = Column(Float)
effect_of_exchange_rate_changes = Column(Float)
end_cash_position = Column(Float)
excess_tax_benefit_from_stock_based_compensation = Column(Float)
extraordinary_items = Column(Float)
financing_cash_flow = Column(Float)
foreign_sales = Column(Float)
free_cash_flow = Column(Float)
gain_loss_on_investment_securities = Column(Float)
gain_loss_on_sale_of_business = Column(Float)
gain_loss_on_sale_of_ppe = Column(Float)
impairment_loss_reversal_recognizedin_profitor_loss = Column(Float)
income_tax_paid_supplemental_data = Column(Float)
income_taxes_refund_paid_cff = Column(Float)
income_taxes_refund_paid_cfi = Column(Float)
increase_decrease_in_deposit = Column(Float)
increase_decreasein_lease_financing = Column(Float)
increasein_interest_bearing_depositsin_bank = Column(Float)
increasein_lease_financing = Column(Float)
interest_credited_on_policyholder_deposits = Column(Float)
interest_paid_cff = Column(Float)
interest_paid_cfo = Column(Float)
interest_paid_direct = Column(Float)
interest_paid_supplemental_data = Column(Float)
interest_received_cfi = Column(Float)
interest_received_cfo = Column(Float)
interest_received_direct = Column(Float)
investing_cash_flow = Column(Float)
issuance_of_capital_stock = Column(Float)
issuance_of_debt = Column(Float)
issuance_paymentof_other_equity_instruments_net = Column(Float)
issue_expenses = Column(Float)
long_term_debt_issuance = Column(Float)
long_term_debt_payments = Column(Float)
minority_interest = Column(Float)
net_business_purchase_and_sale = Column(Float)
net_capital_expenditure_disposals = Column(Float)
net_common_stock_issuance = Column(Float)
net_foreign_currency_exchange_gain_loss = Column(Float)
net_income = Column(Float)
net_income_from_continuing_operations = Column(Float)
net_intangibles_purchase_and_sale = Column(Float)
net_investment_purchase_and_sale = Column(Float)
net_issuance_payments_of_debt = Column(Float)
net_long_term_debt_issuance = Column(Float)
net_other_financing_charges = Column(Float)
net_other_investing_changes = Column(Float)
net_outward_loans = Column(Float)
net_ppe_purchase_and_sale = Column(Float)
net_preferred_stock_issuance = Column(Float)
net_proceeds_payment_for_loan = Column(Float)
net_short_term_debt_issuance = Column(Float)
net_technology_purchase_and_sale = Column(Float)
operating_cash_flow = Column(Float)
operating_gains_losses = Column(Float)
#other_adjustmentsfor_which_cash_effects_are_investingor_financing_cash_flow = Column(Float)
other_cash_paymentsfrom_operating_activities = Column(Float)
other_cash_receiptsfrom_operating_activities = Column(Float)
other_financing = Column(Float)
other_non_cash_items = Column(Float)
other_operating_inflows_outflowsof_cash = Column(Float)
payment_for_loans = Column(Float)
#paymentsfor_premiumsand_claims_annuitiesand_other_policy_benefits = Column(Float)
paymentsof_other_equity_instruments = Column(Float)
paymentson_behalfof_employees = Column(Float)
paymentsto_acquire_held_to_maturity_investments = Column(Float)
paymentsto_suppliersfor_goodsand_services = Column(Float)
pension_and_employee_benefit_expense = Column(Float)
preferred_stock_dividend_paid = Column(Float)
preferred_stock_issuance = Column(Float)
preferred_stock_payments = Column(Float)
proceeds_from_issuance_of_warrants = Column(Float)
proceeds_from_loans = Column(Float)
proceeds_from_stock_option_exercised = Column(Float)
#proceeds_payment_federal_funds_sold_and_securities_purchased_under_agreement_to_resell = Column(Float)
proceeds_payment_in_interest_bearing_deposits_in_bank = Column(Float)
proceedsfrom_disposalof_held_to_maturity_investments = Column(Float)
proceedsfrom_government_grants_cff = Column(Float)
proceedsfrom_government_grants_cfi = Column(Float)
proceedsfrom_issuing_other_equity_instruments = Column(Float)
profiton_disposals = Column(Float)
provision_for_loan_lease_and_other_losses = Column(Float)
provisionand_write_offof_assets = Column(Float)
purchase_of_business = Column(Float)
purchase_of_equity_securities = Column(Float)
purchase_of_fixed_maturity_securities = Column(Float)
purchase_of_intangibles = Column(Float)
purchase_of_investment = Column(Float)
purchase_of_long_term_investments = Column(Float)
purchase_of_ppe = Column(Float)
purchase_of_short_term_investments = Column(Float)
purchase_of_technology = Column(Float)
purchaseof_joint_venture_associate = Column(Float)
purchaseof_subsidiaries = Column(Float)
realized_gain_loss_on_sale_of_loans_and_lease = Column(Float)
receiptsfrom_customers = Column(Float)
reorganization_other_costs = Column(Float)
repayment_of_debt = Column(Float)
repaymentin_lease_financing = Column(Float)
repurchase_of_capital_stock = Column(Float)
sale_of_business = Column(Float)
sale_of_intangibles = Column(Float)
sale_of_investment = Column(Float)
sale_of_long_term_investments = Column(Float)
sale_of_ppe = Column(Float)
sale_of_short_term_investments = Column(Float)
sale_of_technology = Column(Float)
saleof_joint_venture_associate = Column(Float)
saleof_subsidiaries = Column(Float)
sales_of_equity_securities = Column(Float)
sales_of_fixed_maturity_securities = Column(Float)
shareof_associates = Column(Float)
short_term_debt_issuance = Column(Float)
short_term_debt_payments = Column(Float)
stock_based_compensation = Column(Float)
taxes_refund_paid = Column(Float)
taxes_refund_paid_direct = Column(Float)
total_adjustmentsfor_non_cash_items = Column(Float)
unrealized_gain_loss_on_investment_securities = Column(Float)
unrealized_gains_losses_on_derivatives = Column(Float)
last_updated = Column(Date)
class CompanyReference(Base):
__tablename__ = 'company_reference'
company_reference_id = Column(Integer, ForeignKey(Fundamentals.id), primary_key=True)
business_country_id = Column(String(255))
cik = Column(String(255))
company_status = Column(String(255))
country_id = Column(String(255))
fiscal_year_end = Column(String(255))
industry_template_code = Column(String(255))
legal_name = Column(String(255))
legal_name_language_code = Column(String(255))
primary_exchange_id = Column(String(255))
primary_share_class_id = Column(String(255))
primary_symbol = Column(String(255))
short_name = Column(String(255))
standard_name = Column(String(255))
last_updated = Column(Date)
class EarningsRatios(Base):
__tablename__ = 'earnings_ratios'
earnings_ratios_id = Column(Integer, ForeignKey(Fundamentals.id), primary_key=True)
diluted_cont_eps_growth = Column(Float)
diluted_eps_growth = Column(Float)
dps_growth = Column(Float)
equity_per_share_growth = Column(Float)
last_updated = Column(Date)
class EarningsReport(Base):
__tablename__ = 'earnings_report'
earnings_report_id = Column(Integer, ForeignKey(Fundamentals.id), primary_key=True)
accession_number = Column(Float)
basic_accounting_change = Column(Float)
basic_average_shares = Column(Float)
basic_continuous_operations = Column(Float)
basic_discontinuous_operations = Column(Float)
basic_eps = Column(Float)
basic_eps_other_gains_losses = Column(Float)
basic_extraordinary = Column(Float)
continuing_and_discontinued_basic_eps = Column(Float)
continuing_and_discontinued_diluted_eps = Column(Float)
diluted_accounting_change = Column(Float)
diluted_average_shares = Column(Float)
diluted_continuous_operations = Column(Float)
diluted_discontinuous_operations = Column(Float)
diluted_eps = Column(Float)
diluted_eps_other_gains_losses = Column(Float)
diluted_extraordinary = Column(Float)
dividend_per_share = Column(Float)
file_date = Column(Date)
form_type = Column(Float)
normalized_basic_eps = Column(Float)
normalized_diluted_eps = Column(Float)
period_ending_date = Column(Date)
tax_loss_carryforward_basic_eps = Column(Float)
tax_loss_carryforward_diluted_eps = Column(Float)
last_updated = Column(Date)
class FinancialStatementFiling(Base):
__tablename__ = 'financial_statement_filing'
financial_statement_filing_id = Column(Integer, ForeignKey(Fundamentals.id), primary_key=True)
accession_number = Column(String(255))
file_date = Column(Date)
form_type = Column(String(255))
period_ending_date = Column(Date)
last_updated = Column(Date)
class GeneralProfile(Base):
__tablename__ = 'general_profile'
general_profile_id = Column(Integer, ForeignKey(Fundamentals.id), primary_key=True)
contact_email = Column(Float)
headquarter_address_line1 = Column(Float)
headquarter_address_line2 = Column(Float)
headquarter_address_line3 = Column(Float)
headquarter_address_line4 = Column(Float)
headquarter_city = Column(Float)
headquarter_country = Column(Float)
headquarter_fax = Column(Float)
headquarter_homepage = Column(Float)
headquarter_phone = Column(Float)
headquarter_postal_code = Column(Float)
headquarter_province = Column(Float)
short_description = Column(Float)
total_employee_number = Column(Float)
last_updated = Column(Date)
class OperationRatios(Base):
__tablename__ = 'operation_ratios'
operation_ratios_id = Column(Integer, ForeignKey(Fundamentals.id), primary_key=True)
assets_turnover = Column(Float)
cash_conversion_cycle = Column(Float)
common_equity_to_assets = Column(Float)
current_ratio = Column(Float)
days_in_inventory = Column(Float)
days_in_payment = Column(Float)
days_in_sales = Column(Float)
debtto_assets = Column(Float)
ebit_margin = Column(Float)
ebitda_margin = Column(Float)
financial_leverage = Column(Float)
fix_assets_turonver = Column(Float)
gross_margin = Column(Float)
interest_coverage = Column(Float)
inventory_turnover = Column(Float)
long_term_debt_equity_ratio = Column(Float)
long_term_debt_total_capital_ratio = Column(Float)
net_income_cont_ops_growth = Column(Float)
net_income_growth = Column(Float)
net_margin = Column(Float)
normalized_net_profit_margin = Column(Float)
operation_income_growth = Column(Float)
operation_margin = Column(Float)
operation_revenue_growth3_month_avg = Column(Float)
payment_turnover = Column(Float)
pretax_margin = Column(Float)
quick_ratio = Column(Float)
receivable_turnover = Column(Float)
revenue_growth = Column(Float)
roa = Column(Float)
roe = Column(Float)
roic = Column(Float)