Skip to content

Commit

Permalink
travi_CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lit26 committed Aug 21, 2020
2 parents c71a644 + 6895749 commit 4cc398b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
Binary file modified asset/tsla.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------
Expand Down
12 changes: 8 additions & 4 deletions finvizfinance/earnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions finvizfinance/quote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=''):
Expand Down
1 change: 0 additions & 1 deletion finvizfinance/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '[email protected]'
Expand Down

0 comments on commit 4cc398b

Please sign in to comment.