forked from infinite-Joy/stock-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
balance_sheet.py
19 lines (14 loc) · 939 Bytes
/
balance_sheet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from try_module import trying as trying
from try_module import get_correct_ratio
class BalanceSheet:
def __init__(self, tree):
self.tree = tree
def get_current_assets_loans_advances(self, tree):
current_assets_loans_advances1 = trying(tree, '/html/body/div[2]/div[5]/table/tbody/tr[20]/td[2]/text()')
current_assets_loans_advances2 = trying(tree, '/html/body/div[2]/div[5]/table/tbody/tr[20]/td[3]/text()')
return get_correct_ratio(current_assets_loans_advances1, current_assets_loans_advances2)
def get_current_liabilities_and_provisions(self, tree):
current_liabilities_and_provisions = trying(tree, '/html/body/div[2]/div[5]/table/tbody/tr[21]/td[2]/text()')
return current_liabilities_and_provisions
def get_total_net_current_assets(self, tree):
return trying(tree, '/html/body/div[2]/div[5]/table/tbody/tr[22]/td[2]/text()')