diff --git a/asset/tsla.jpg b/asset/tsla.jpg index fb88f6b..e71aca2 100644 Binary files a/asset/tsla.jpg and b/asset/tsla.jpg differ diff --git a/docs/conf.py b/docs/conf.py index a9acd67..705f9ca 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ author = 'Tianning Li' # The full version, including alpha/beta/rc tags -release = '0.6.1' +release = '0.6.2' # -- General configuration --------------------------------------------------- diff --git a/finvizfinance/earnings.py b/finvizfinance/earnings.py index 23342c4..fd08304 100644 --- a/finvizfinance/earnings.py +++ b/finvizfinance/earnings.py @@ -17,17 +17,21 @@ class Earnings: """Earnings Partition dataframe of ticker information of period of earning dates(This Week, Next Week, Previous Week, This Month) into dates - + + Args: + period(str): choose an option of period(This Week, Next Week, + Previous Week, This Month). """ - def __init__(self): + def __init__(self, period='This Week'): """initiate module """ self.earning_days = [] self.df_days = {} self.df = None - self.period = '' + self.period = period + self._setPeriod(period) - def setPeriod(self, period='This Week'): + def _setPeriod(self, period): """Set the period. Args: diff --git a/finvizfinance/quote.py b/finvizfinance/quote.py index bb3095b..7564c11 100644 --- a/finvizfinance/quote.py +++ b/finvizfinance/quote.py @@ -15,25 +15,27 @@ class finvizfinance: Args: ticker(str): ticker string + verbose(int): choice of visual the progress. 1 for visualize progress. """ - def __init__(self,ticker): + def __init__(self, ticker, verbose=0): """initiate module """ self.ticker = ticker self.flag = False self.quote_url = QUOTE_URL.format(ticker=ticker) self.soup = webScrap(self.quote_url) - if self._checkexist(): + if self._checkexist(verbose): self.flag = True self.info = {} - def _checkexist(self): + def _checkexist(self, verbose): try: if 'not found' in self.soup.find('td', class_='body-text').text: print('Ticker not found.') return False except: - print('Ticker exists.') + if verbose == 1: + print('Ticker exists.') return True def TickerCharts(self, timeframe='daily', charttype='advanced', out_dir=''): diff --git a/finvizfinance/util.py b/finvizfinance/util.py index 1643a01..db6b0c6 100644 --- a/finvizfinance/util.py +++ b/finvizfinance/util.py @@ -40,7 +40,6 @@ def imageScrap(url, ticker, out_dir): f = open('{}{}.jpg'.format(out_dir, ticker), "wb") f.write(r.content) f.close() - print('Done') else: print('Error...') print(r.status_code) diff --git a/setup.py b/setup.py index 391003d..b7faba6 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ HERE = pathlib.Path(__file__).parent -VERSION = '0.6.1' +VERSION = '0.6.2' PACKAGE_NAME = 'finvizfinance' AUTHOR = 'Tianning Li' AUTHOR_EMAIL = 'ltianningli@gmail.com'