Skip to main content

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

Project description

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:

  1. Retrieve multiple-ticker intraday price data in a wide-form pandas dataframe;
  2. Read options data for all available expiration dates;
  3. 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")

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yfinance_extended-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

yfinance_extended-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file yfinance_extended-0.1.0.tar.gz.

File metadata

  • Download URL: yfinance_extended-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for yfinance_extended-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c174d58ebb4544d7ccf520a271ef86665c9e45eca470512c35450f46fe83af9
MD5 7c5354510e3bc677c02cdc6438236c2e
BLAKE2b-256 10837997e4ec56d54aa0e783bdc3817f778c4b34198d6798323bd60b19f9ef6c

See more details on using hashes here.

File details

Details for the file yfinance_extended-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for yfinance_extended-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85938af0944f6e27e46067e3c9509c19dde1ee32d8247bcb5ff31ead459725a7
MD5 ea3bb8faf7155279c6f6976426e3e425
BLAKE2b-256 3975d425adcc3ecfb8f9876b5237ffcd7324b885c96bf6e35d9bf1466ba04877

See more details on using hashes here.

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