-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfundamental_data.py
More file actions
73 lines (51 loc) · 1.77 KB
/
Copy pathfundamental_data.py
File metadata and controls
73 lines (51 loc) · 1.77 KB
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
from alpha_vantage.alphavantage import AlphaVantage as av
from functools import wraps
def format_income_statement(func):
@wraps(func)
def _format_wrapper(self, *args, **kwargs):
call_response, data_key, meta_data_key = func(
self, *args)
return call_response, None
return _format_wrapper
def format_balance_sheet(func):
@wraps(func)
def _format_wrapper(self, *args, **kwargs):
call_response, data_key, meta_data_key = func(
self, *args)
return call_response, None
return _format_wrapper
def format_cash_flow(func):
@wraps(func)
def _format_wrapper(self, *args, **kwargs):
call_response, data_key, meta_data_key = func(
self, *args)
return call_response, None
return _format_wrapper
def format_company_overview(func):
@wraps(func)
def _format_wrapper(self, *args, **kwargs):
call_response, data_key, meta_data_key = func(
self, *args)
return call_response, None
return _format_wrapper
class FundamentalData(av):
@format_income_statement
@av._call_api_on_func
def get_income_statement(self, symbol):
_FUNCTION_KEY = "INCOME_STATEMENT"
return _FUNCTION_KEY, 'INCOME_STATEMENT', 'Meta Data'
@format
@av._call_api_on_func
def get_balance_sheet(self, symbol):
_FUNCTION_KEY = "BALANCE_SHEET"
return _FUNCTION_KEY, 'BALANCE_SHEET', 'Meta Data'
@format
@av._call_api_on_func
def get_cash_flow(self, symbol):
_FUNCTION_KEY = "CASH_FLOW"
return _FUNCTION_KEY, 'CASH_FLOW', 'Meta Data'
@format
@av._call_api_on_func
def get_company_overview(self, symbol):
_FUNCTION_KEY = "OVERVIEW"
return _FUNCTION_KEY, 'OVERVIEW', 'Meta Data'