Socket
Book a DemoInstallSign in
Socket

yfinance-extended

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yfinance-extended

Extension of yfinance package to download wide-form stock data from Yahoo! Finance

0.0.3
pipPyPI
Maintainers
1

yfinance Package with Wide-Form Data Support and Data Export

Note: currently being refactored to use Spark DataFrame instead of pandas to perform transformations.

yfinance-extended extends yfinance package by Ran Aroussi and make it easier to:

  • Retrieve multiple-ticker intraday price data in a wide-form pandas dataframe;
  • Read options data for all available expiration dates;
  • Retrieve top-of-the-book bid-ask prices and size

Sample Usage

Get Historical Data

Getting past five days of minute-by-minute prices of Apple, Inc., including pre-/post-market data.

import yfinance_extended as yfe

aapl = yfe.StockSymbols(symbols="AAPL")
aapl_price_df = get_historical_prices(aapl, period="5d", interval="1m", prepost=True)

symbols = yfe.StockSymbols(symbols=["AAPL", "GOOGL"])
prices_df = get_historical_prices(symbols, period="5d", interval="1m", prepost=True)

Read all Available Options Information

aapl = yfe.StockSymbols(symbols="AAPL")
options_df = yfe.get_live_options(aapl)

Get Top-of-the-Book Data

aapl = yfe.StockSymbols(symbols="AAPL")
aapl_price_df = yfe.get_live_quote(aapl)
live_prices_df = loader.get_prices(["AAPL", "GOOGL"])

Alternatively, if you wish to save all data into one file:

# Write to one file
yfe.to_parquet(prices_df, filepath="./data/datafile.parquet")

# Read from the file
prices_df = yfe.read_parquet(filepath="./data/datafile.parquet")

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.