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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yfinance_extended-0.1.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yfinance_extended-0.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for yfinance_extended-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e43870bf254203d5771238cb1a3892a9f0902edfbc1c6328490778ae8f51774e
MD5 ca6efdf2461f70dfb669a059b2e8161b
BLAKE2b-256 763c58ed36a7711f04419d4bb39a807537ddf34ba2d728e1e0ce8b2fddcb0bb9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yfinance_extended-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a90deb4547c44ee4db31a6b572745656ff9681eca855c4384430a31a2d371b7
MD5 bf71b27a33ea4d53ccf88e237c787d3f
BLAKE2b-256 0cb03b8c85e0d77b014010de75a4b2a266e8165198e98784aed38bd8690f9d4b

See more details on using hashes here.

Supported by

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