Skip to content

Commit

Permalink
Add update in args for database force update
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmysitu committed Mar 18, 2024
1 parent 70e25b7 commit 0687ba1
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions msfinance/stocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ def get_growth(self, ticker, exchange, update=False):
DataFrame of statistics
'''
statistics = 'Growth'
return self._get_valuation(ticker, exchange, statistics)
return self._get_valuation(ticker, exchange, statistics, update)

def get_operating_and_efficiency(self, ticker, exchange):
def get_operating_and_efficiency(self, ticker, exchange, update=False):
'''
Get operating and efficiency statistics of stock
Expand All @@ -367,9 +367,9 @@ def get_operating_and_efficiency(self, ticker, exchange):
DataFrame of statistics
'''
statistics = 'Operating and Efficiency'
return self._get_valuation(ticker, exchange, statistics)
return self._get_valuation(ticker, exchange, statistics, update)

def get_financial_health(self, ticker, exchange):
def get_financial_health(self, ticker, exchange, update=False):
'''
Get financial health statistics of stock
Expand All @@ -380,9 +380,9 @@ def get_financial_health(self, ticker, exchange):
DataFrame of statistics
'''
statistics = 'Financial Health'
return self._get_valuation(ticker, exchange, statistics)
return self._get_valuation(ticker, exchange, statistics, update)

def get_cash_flow(self, ticker, exchange):
def get_cash_flow(self, ticker, exchange, update=False):
'''
Get cash flow statistics of stock
Expand All @@ -393,9 +393,9 @@ def get_cash_flow(self, ticker, exchange):
DataFrame of statistics
'''
statistics = 'Cash Flow'
return self._get_valuation(ticker, exchange, statistics)
return self._get_valuation(ticker, exchange, statistics, update)

def get_valuations(self, ticker, exchange):
def get_valuations(self, ticker, exchange, update=False):
'''
Get all valuations of stock
Expand All @@ -408,12 +408,12 @@ def get_valuations(self, ticker, exchange):

self.valuations = []
for statistics in ['Growth', 'Operating and Efficiency', 'Financial Health','Cash Flow']:
df = self._get_valuation(ticker, exchange, statistics)
df = self._get_valuation(ticker, exchange, statistics, update)
self.valuations.append(df)

return self.valuations

def get_income_statement(self, ticker, exchange, period='Annual', stage='Restated'):
def get_income_statement(self, ticker, exchange, period='Annual', stage='Restated', update=False):
'''
Get income statement of stock
Expand All @@ -426,9 +426,9 @@ def get_income_statement(self, ticker, exchange, period='Annual', stage='Restate
DataFrame of income statement
'''
statement = 'Income Statement'
return self._get_financials(ticker, exchange, statement, period, stage)
return self._get_financials(ticker, exchange, statement, period, stage, update)

def get_balance_sheet_statement(self, ticker, exchange, period='Annual', stage='Restated'):
def get_balance_sheet_statement(self, ticker, exchange, period='Annual', stage='Restated', update=False):
'''
Get balance sheet statement of stock
Expand All @@ -441,9 +441,9 @@ def get_balance_sheet_statement(self, ticker, exchange, period='Annual', stage='
DataFrame of balance sheet statement
'''
statement = 'Balance Sheet'
return self._get_financials(ticker, exchange, statement, period, stage)
return self._get_financials(ticker, exchange, statement, period, stage, update)

def get_cash_flow_statement(self, ticker, exchange, period='Annual', stage='Restated'):
def get_cash_flow_statement(self, ticker, exchange, period='Annual', stage='Restated', update=False):
'''
Get cash flow statement of stock
Expand All @@ -456,9 +456,9 @@ def get_cash_flow_statement(self, ticker, exchange, period='Annual', stage='Rest
DataFrame of cash flow statement
'''
statement = 'Cash Flow'
return self._get_financials(ticker, exchange, statement, period, stage)
return self._get_financials(ticker, exchange, statement, period, stage, update)

def get_financials(self, ticker, exchange, period='Annual', stage='As Originally Reported'):
def get_financials(self, ticker, exchange, period='Annual', stage='As Originally Reported', update=False):
'''
Get all financials statements of stock
Expand All @@ -473,7 +473,7 @@ def get_financials(self, ticker, exchange, period='Annual', stage='As Originally

self.financials = []
for statement in ['Income Statement', 'Balance Sheet', 'Cash Flow']:
df = self._get_financials(ticker, exchange, statement, period, stage)
df = self._get_financials(ticker, exchange, statement, period, stage, update)
self.financials.append(df)

return self.financials
Expand Down

0 comments on commit 0687ba1

Please sign in to comment.