Welcome to Finviz Finance in Python’s documentation!¶
It is a Finviz Finance information downloader.
Installation (python >= v3.5)¶
> virtualenv -p python3 virtualenvironment
> source virtualenvironment/bin/activate
> pip install finvizfinance
Quote Examples¶
import pandas as pd
from finvizfinance.quote import finvizfinance
stock = finvizfinance('tsla')
Example downloading chart:
stock.TickerCharts(out_dir='asset')
Example getting individual ticker information
stock_fundament = stock.ticker_fundament()
stock_description = stock.ticker_description()
outer_ratings_df = stock.ticker_outer_ratings()
news_df = stock.ticker_news()
inside_trader_df = stock.ticker_inside_trader()
Screener Example¶
from finvizfinance.screener.overview import Overview
foverview = Overview()
filters_dict = {'Exchange':'AMEX','Sector':'Basic Materials'}
foverview.set_filter(filters_dict=filters_dict)
df = foverview.screener_view()
df.head()
News Example¶
from finvizfinance.news import News
fnews = News()
all_news = fnews.get_news()
# all_news['news'].head()
# all_news['blogs'].head()
Insider Example¶
from finvizfinance.insider import Insider
finsider = Insider(option='top owner trade')
finsider.get_insider().head()
Contents¶
Quote¶
Getting individual ticker information.
-
class
finvizfinance.quote.
Quote
¶ quote Getting current price of the ticker
-
get_current
(ticker)¶ Getting current price of the ticker.
Returns: price of the ticker Return type: price(float)
-
-
class
finvizfinance.quote.
Statements
¶ Getting statements of ticker
-
get_statements
(ticker, statement='I', timeframe='A')¶ Getting statements of ticker.
Parameters: - ticker (str) – ticker string
- statement (str) – I(Income Statement), B(Balace Sheet), C(Cash Flow)
- timeframe (str) – A(Annual), Q(Quarter)
Returns: statements table
Return type: df(pandas.DataFrame)
-
-
class
finvizfinance.quote.
finvizfinance
(ticker, verbose=0)¶ Getting information from the individual ticker.
Parameters: - ticker (str) – ticker string
- verbose (int) – choice of visual the progress. 1 for visualize progress.
-
ticker_charts
(timeframe='daily', charttype='advanced', out_dir='', urlonly=False)¶ Download ticker charts.
Parameters: - timeframe (str) – choice of timeframe (daily, weekly, monthly).
- charttype (str) – choice of type of chart (candle, line, advanced).
- out_dir (str) – output image directory. default none.
- urlonly (bool) – choice of downloading charts, default: downloading chart
Returns: url for the chart
Return type: charturl(str)
-
ticker_description
()¶ Get ticker description.
Returns: ticker description. Return type: description(str)
-
ticker_full_info
()¶ Get all the ticker information.
Returns: insider information table Return type: df(pandas.DataFrame)
-
ticker_fundament
(raw=True, output_format='dict')¶ Get ticker fundament.
Parameters: - raw (boolean) – if True, the data is raw.
- output_format (str) – choice of output format (dict, series).
Returns: ticker fundament.
Return type: fundament(dict)
-
ticker_inside_trader
()¶ Get insider information table.
Returns: insider information table Return type: df(pandas.DataFrame)
-
ticker_news
()¶ Get news information table.
Returns: news information table Return type: df(pandas.DataFrame)
-
ticker_outer_ratings
()¶ Get outer ratings table.
Returns: outer ratings table Return type: df(pandas.DataFrame)
-
ticker_signal
()¶ Get all the trading signals from finviz.
Returns: get all the ticker signals as list. Return type: ticker_signals(list)
Screener¶
Getting screener information.
Overview¶
-
class
finvizfinance.screener.overview.
Overview
¶ Getting information from the finviz screener overview page.
-
compare
(ticker, compare_list, order='ticker', verbose=1)¶ Get screener table of similar property (Sector, Industry, Country)
Parameters: - ticker (str) – the ticker to compare
- compare_list (list) – choice of compare property (Sector, Industry, Country) or combination.
- order (str) – sort the table by the choice of order
- verbose (int) – choice of visual the progress. 1 for visualize progress
Returns: screener information table
Return type: df(pandas.DataFrame)
-
get_filter_options
(screen_filter)¶ Get filters options.
Parameters: screen_filter (str) – screen filter for checking options Returns: all the available filters Return type: filter_options(list)
-
get_filters
()¶ Get filters.
Returns: all the available filters Return type: filters(list)
-
get_orders
()¶ Get orders.
Returns: all the available orders Return type: orders(list)
-
get_signal
()¶ Get signals.
Returns: all the available trading signals Return type: signals(list)
-
screener_view
(order='ticker', limit=-1, select_page=None, verbose=1, ascend=True)¶ Get screener table.
Parameters: - order (str) – sort the table by the choice of order.
- limit (int) – set the top k rows of the screener.
- select_page (int) – set the page of the screener.
- verbose (int) – choice of visual the progress. 1 for visualize progress.
- ascend (bool) – if True, the order is ascending.
Returns: screener information table
Return type: df(pandas.DataFrame)
-
set_filter
(signal='', filters_dict={}, ticker='')¶ Update the settings.
Parameters: - signal (str) – ticker signal
- filters_dict (dict) – dictionary of filters
- ticker (str) – ticker string
-
Valuation¶
-
class
finvizfinance.screener.valuation.
Valuation
¶ Valuation inherit from overview module. Getting information from the finviz screener valuation page.
Financial¶
-
class
finvizfinance.screener.financial.
Financial
¶ Financial inherit from overview module. Getting information from the finviz screener financial page.
Ownership¶
-
class
finvizfinance.screener.ownership.
Ownership
¶ Ownership inherit from overview module. Getting information from the finviz screener ownership page.
Technical¶
-
class
finvizfinance.screener.technical.
Technical
¶ Technical inherit from overview module. Getting information from the finviz screener technical page.
Custom¶
-
class
finvizfinance.screener.custom.
Custom
¶ Custom inherit from overview module. Getting information from the finviz screener custom page.
-
get_columns
()¶ Get information about the columns
Returns: return the index and column name. Return type: columns(dict)
-
screener_view
(order='ticker', limit=-1, select_page=None, verbose=1, ascend=True, columns=[0, 1, 2, 3, 4, 5, 6, 7, 65, 66, 67])¶ Get screener table.
Parameters: - order (str) – sort the table by the choice of order.
- limit (int) – set the top k rows of the screener.
- select_page (int) – set the page of the screener.
- verbose (int) – choice of visual the progress. 1 for visualize progress.
- ascend (bool) – if True, the order is ascending.
- columns (list) – columns of your choice. Default index: 0,1,2,3,4,5,6,7,65,66,67.
Returns: screener information table
Return type: df(pandas.DataFrame)
-
Tickers¶
-
class
finvizfinance.screener.ticker.
Ticker
¶ Financial inherit from overview module. Getting information from the finviz screener ticker page.
-
screener_view
(order='ticker', limit=-1, verbose=1, ascend=True)¶ Get screener stocks.
Parameters: - order (str) – sort the list by the choice of order.
- limit (int) – set the top k stocks of the screener.
- verbose (int) – choice of visual the progress. 1 for visualize progress.
- ascend (bool) – if True, the order is ascending.
Returns: get all the tickers as list.
Return type: tickers(list)
-
Group¶
Getting group information.
Overview¶
-
class
finvizfinance.group.overview.
Overview
¶ Getting information from the finviz group overview page.
-
get_group
()¶ Get groups.
Returns: all the available groups. Return type: groups(list)
-
get_orders
()¶ Get orders.
Returns: all the available orders. Return type: orders(list)
-
screener_view
(group='Sector', order='Name')¶ Get screener table.
Parameters: - group (str) – choice of group option.
- order (str) – sort the table by the choice of order.
Returns: group information table.
Return type: df(pandas.DataFrame)
-
Valuation¶
-
class
finvizfinance.group.valuation.
Valuation
¶ Valuation inherit from overview module. Getting information from the finviz group valuation page.
Performance¶
-
class
finvizfinance.group.performance.
Performance
¶ Performance inherit from overview module. Getting information from the finviz group performance page.
Spectrum¶
-
class
finvizfinance.group.spectrum.
Spectrum
¶ Spectrum inherit from overview module. Getting information from the finviz group spectrum page.
-
screener_view
(group='Sector', order='Name', out_dir='')¶ Get screener table.
Parameters: - group (str) – choice of group option.
- order (str) – sort the table by the choice of order.
-
News¶
Getting trading news.
Insider¶
Getting trading insider.
-
class
finvizfinance.insider.
Insider
(option='latest')¶ Getting information from the finviz insider page.
Parameters: option (str) – choose a option (latest, latest buys, latest sales, top week, top week buys, top week sales, top owner trade, top owner buys, top owner sales, insider_id) -
get_insider
()¶ Get insider information table.
Returns: insider information table Return type: df(pandas.DataFrame)
-
Forex¶
Getting foreign exchange information.
-
class
finvizfinance.forex.
Forex
¶ Getting information from the finviz forex page.
-
chart
(forex, timeframe='D', urlonly=False)¶ Get forex chart.
Parameters: - forex (str) – foreign exchange name
- timeframe (str) – choice of timeframe(5M, H, D, W, M)
- urlonly (bool) – choice of downloading charts, default: downloading chart
Returns: url for the chart
Return type: charturl(str)
-
performance
(change='percent')¶ Get forex performance table.
Parameters: change (str) – choose an option of change(percent, PIPS) Returns: forex performance table Return type: df(pandas.DataFrame)
-
Crypto¶
Getting crypto currency information.
-
class
finvizfinance.crypto.
Crypto
¶ Getting information from the finviz crypto page.
-
chart
(crypto, timeframe='D', urlonly=False)¶ Get crypto chart.
Parameters: - crypto (str) – crypto currency
- timeframe (str) – choice of timeframe(5M, H, D, W, M)
- urlonly (bool) – choice of downloading charts, default: downloading chart
Returns: url for the chart
Return type: charturl(str)
-
performance
()¶ Get crypto performance table.
Returns: crypto performance table Return type: df(pandas.DataFrame)
-
Future¶
Getting future information.
Earnings¶
Getting earning dates information.
-
class
finvizfinance.earnings.
Earnings
(period='This Week')¶ Partition dataframe of ticker information of period of earning dates(This Week, Next Week, Previous Week, This Month) into dates
Parameters: period (str) – choose an option of period(This Week, Next Week, Previous Week, This Month). -
output_csv
(output_dir='earning_days')¶ Output dataframes to csv files.
Parameters: output_dir (str) – name of the output directory.
-
output_excel
(output_file='earning_days.xlsx')¶ Output dataframes to single Excel file.
Parameters: output_file (str) – name of the output excel file.
-
partition_days
(mode='financial')¶ Partition dataframe to separate dataframes according to the dates.
Parameters: mode (str) – choose an option of period(financial, overview, valuation, ownership, performance, technical).
-