Skip to main content

A package to get stock data from Yahoo Finance

Project description

Publish Python Package to PyPI PyPI version

Code style: black Code style: isort flake8

Documentation Status

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 of the stock you want to access. Then, you can access the following data:

from stockdex import Ticker

# Pick arbitrary ticker
ticker = Ticker('AAPL')

price data:

Pass the range and interval (by default, range is '1d' and interval is '1m') to get a dataframe of the stock's historical price data including open, high, low, close, and volume on each timestamp.

price = ticker.price(range='1y', dataGranularity='1d')

Trading periods:

Get the current trading period of the stock (pre-market, regular, post-market).

current_trading_period = ticker.current_trading_period

Summary data:

summary = ticker.summary

Historical data:

statistics = ticker.statistics

Financial data:

income_stmt = ticker.income_stmt
balance_sheet = ticker.balance_sheet
cash_flow = ticker.cash_flow

Analyst data:

analysis = ticker.analysis

Option data:

calls = ticker.calls
puts = ticker.puts

Profile data:

key_executives = ticker.key_executives
description = ticker.description
corporate_governance = ticker.corporate_governance

Holders data:

major_holders = ticker.major_holders
top_institutional_holders = ticker.top_institutional_holders
top_mutual_fund_holders = ticker.top_mutual_fund_holders

Dividends data from Digrin Webstite:

History of dividends paid by the company.

dividend = ticker.dividend


Check out sphinx documentation here for more information about the package.

Project details


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.1.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

stockdex-0.3.1-py3-none-any.whl (9.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page