FinViz¶
Note
This library is ideal for fundamentals and sentiment analysis projects.
Note
Refer to FinViz Jupyter Notebook for more details.
Table of Contents¶
Installation¶
Install with pip:
pip install finvizfinance
Or install from github:
git clone https://github.com/lit26/finvizfinance.git
Usage¶
Import all necessary libraries:
from finvizfinance.quote import finvizfinance
import pandas as pd
stock = finvizfinance('tsla')
Stock Fundamentals¶
Getting information (fundamentals, description, outer rating, stock news, inside trader) of an individual stock.
chart = stock.ticker_charts()
chart
stock_fundament = stock.ticker_fundament()
Ticker Description¶
Outputs a brief description of the chosen stock. ‘Tesla, Inc. designs, develops, manufactures, …’
description = stock.ticker_description()
Multiple Tickers¶
Getting multiple tickers’ information according to the filters.
from finvizfinance.screener.overview import Overview
foverview = Overview()
filters_dict = {'Index':'S&P 500','Sector':'Basic Materials'}
foverview.set_filter(filters_dict=filters_dict)
df = foverview.screener_view()
Sentiment and News¶
Gets recent financial news, including a rating for sentiment.
outer_ratings_df = stock.ticker_outer_ratings()
news_df = stock.ticker_news()
from finvizfinance.news import News
fnews = News()
all_news = fnews.get_news()
all_news['news'].head() # 'blogs'
Insider Trades¶
Outputs a Pandas DataFrame of insider trades, their relationship, cost, value, number of shares, and more.
inside_trader_df = stock.ticker_inside_trader()
from finvizfinance.insider import Insider
finsider = Insider(option='top owner trade')
# option: latest, top week, top owner trade
# default: latest
insider_trader = finsider.get_insider()