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.TickerFundament()
stock_description = stock.TickerDescription()
outer_ratings_df = stock.TickerOuterRatings()
news_df = stock.TickerNews()
inside_trader_df = stock.TickerInsideTrader()

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.ScreenerView()
df.head()

News Example

from finvizfinance.news import News
fnews = News()
all_news = fnews.getNews()
# all_news['news'].head()
# all_news['blogs'].head()

Insider Example

from finvizfinance.insider import Insider
finsider = Insider(option='top owner trade')
finsider.getInsider().head()

Contents

Quote

Getting individual ticker information.

class finvizfinance.quote.Quote

quote Getting current price of the ticker

getCurrent(ticker)

Getting current price of the ticker.

Returns:price of the ticker
Return type:price(float)
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.
TickerCharts(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)

TickerDescription()

Get ticker description.

Returns:ticker description.
Return type:description(str)
TickerFullInfo()

Get all the ticker information.

Returns:insider information table
Return type:df(pandas.DataFrame)
TickerFundament()

Get ticker fundament.

Returns:ticker fundament.
Return type:fundament(dict)
TickerInsideTrader()

Get insider information table.

Returns:insider information table
Return type:df(pandas.DataFrame)
TickerNews()

Get news information table.

Returns:news information table
Return type:df(pandas.DataFrame)
TickerOuterRatings()

Get outer ratings table.

Returns:outer ratings table
Return type:df(pandas.DataFrame)
TickerSignal()

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.

ScreenerView(order='ticker', limit=-1, 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.
  • 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)

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)

getFilterOptions(screen_filter)

Get filters options.

Parameters:screen_filter (str) – screen filter for checking options
Returns:all the available filters
Return type:filter_options(list)
getFilters()

Get filters.

Returns:all the available filters
Return type:filters(list)
getOrders()

Get orders.

Returns:all the available orders
Return type:orders(list)
getSignal()

Get signals.

Returns:all the available trading signals
Return type:signals(list)
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.

ScreenerView(order='ticker', limit=-1, 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.
  • 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)

getColumns()

Get information about the columns

Returns:return the index and column name.
Return type:columns(dict)

Tickers

class finvizfinance.screener.ticker.Ticker

Financial inherit from overview module. Getting information from the finviz screener ticker page.

ScreenerView(limit=-1, verbose=1)

Get screener table.

Parameters:verbose (int) – choice of visual the progress. 1 for visualize progress.
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.

ScreenerView(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)

getGroup()

Get groups.

Returns:all the available groups.
Return type:groups(list)
getOrders()

Get orders.

Returns:all the available orders.
Return type:orders(list)

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.

ScreenerView(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.

class finvizfinance.news.News

Getting information from the finviz news page.

getNews()

Get insider information table.

Retrieves table information from finviz finance news.

Returns:news table
Return type:news(dict)

Insider

Getting trading insider.

class finvizfinance.insider.Insider(option='latest')

Getting information from the finviz insider page.

Parameters:option (str) – choose a option (latest, top week, top owner trade, insider_id)
getInsider()

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.

class finvizfinance.future.Future

Getting information from the finviz future page.

performance(timeframe='D')

Get forex performance table.

Parameters:timeframe (str) – choice of timeframe(D, W, M, Q, HY, Y)
Returns:forex performance table
Return type:df(pandas.DataFrame)

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).
outputCSV(output_dir='earning_days')

Output dataframes to csv files.

Parameters:output_dir (str) – name of the output directory.
outputExcel(output_file='earning_days.xlsx')

Output dataframes to single Excel file.

Parameters:output_file (str) – name of the output excel file.
partitionDays(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).

Indices and tables