A package to get stock data from Yahoo Finance
Project description
Stockdex
Stockdex is a Python package that provides a simple interface to access financial data from Yahoo Finance. Data is returned as a pandas DataFrame.
Installation
Install the package using pip:
pip install stockdex
Usage
Create a Ticker
object by passing the ticker symbol. Ticker objects are the main interface to retrieve stock data.
from stockdex import Ticker
# Pick arbitrary ticker
ticker = Ticker('AAPL')
Fundamental data from Yahoo Finance
API (fast queries):
# Price data
price = ticker.price(range='1y', dataGranularity='1d')
# Current trading period of the stock (pre-market, regular, post-market)
current_trading_period = ticker.current_trading_period
income_statement = ticker.income_statement()
cash_flow = ticker.cash_flow()
balance_sheet = ticker.balance_sheet()
financials = ticker.financials()
Fundamental data that is seen in the Yahoo Finance
website:
# Summary including general financial information
summary = ticker.summary
# Financial data as it is seen in the yahoo finance website
income_stmt = ticker.income_stmt
balance_sheet = ticker.balance_sheet_web
cash_flow = ticker.cash_flow_web
# Analysts and estimates
analysis = ticker.analysis
# Data about options
calls = ticker.calls
puts = ticker.puts
# Profile data
key_executives = ticker.key_executives
description = ticker.description
corporate_governance = ticker.corporate_governance
# Data about shareholders
major_holders = ticker.major_holders
top_institutional_holders = ticker.top_institutional_holders
top_mutual_fund_holders = ticker.top_mutual_fund_holders
# Main statistics
statistics = ticker.statistics
Dividends data from Digrin
Webstite:
All dividends paid by the company are returned as a pandas DataFrame.
dividend = ticker.dividend
Check out sphinx documentation here for more information about the package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stockdex-0.3.4.tar.gz
(14.1 kB
view hashes)
Built Distribution
stockdex-0.3.4-py3-none-any.whl
(15.2 kB
view hashes)