Skip to main content

polars-yahoo

Minimal Yahoo Finance price history, returned as polars DataFrames. No pandas, two dependencies (polars, curl_cffi), and three things only: OHLCV bars, dividends and splits.

Inspired by yfinance; written from scratch. Not affiliated with Yahoo — check Yahoo's terms of use before relying on the data.

Install

uv add polars-yahoo

Use

These calls go to Yahoo, so the README check skips this block (+RHIZA_SKIP).

import polars_yahoo as yh

# One symbol
yh.Ticker("AAPL").history(period="1y")  # daily bars
yh.Ticker("AAPL").history(start="2024-01-01", end="2024-07-01", interval="1wk")
yh.Ticker("SAP.DE").history(period="5d", interval="5m")  # intraday

# Several symbols, fetched concurrently, stacked into one long frame
yh.download(["AAPL", "MSFT", "SAP.DE"], period="6mo")

# Corporate actions (full history)
yh.Ticker("AAPL").dividends()
yh.Ticker("AAPL").splits()

Output

Price frames are long-format, one row per ticker and bar:

column type notes
ticker String
date Date daily and longer intervals; the exchange-local calendar date
timestamp Datetime(us, tz) intraday intervals instead of date; exchange time zone
open, high, low, close Float64 as Yahoo reports them, unadjusted
adj_close Float64 Yahoo's split- and dividend-adjusted close; null for intraday
volume Int64

download converts intraday timestamps to UTC when the symbols trade in different time zones, because a polars column holds one time zone.

To adjust OHLC yourself:

import polars as pl

df = pl.DataFrame({"open": [10.0], "high": [12.0], "low": [9.0], "close": [11.0], "adj_close": [5.5]})
adjusted = df.with_columns(pl.col("open", "high", "low", "close") * pl.col("adj_close") / pl.col("close"))
print(adjusted.row(0))
(5.0, 6.0, 4.5, 5.5, 5.5)

dividends() returns ticker, date, dividend; splits() returns ticker, date, numerator, denominator, ratio.

Arguments

  • period: 1d 5d 1mo 3mo 6mo 1y 2y 5y 10y ytd max (ignored when start is given)
  • interval: 1m 2m 5m 15m 60m 90m 1h 1d 5d 1wk 1mo 3mo. Yahoo caps how far back intraday data goes (about 7 days for 1m, 60 days for other minute bars, 730 days for hourly).
  • start / end: date, datetime or ISO string. Naive values are UTC; end is exclusive.
  • prepost: include pre- and post-market bars (intraday only).

Errors

All errors subclass polars_yahoo.YahooError: TickerNotFoundError (unknown or delisted symbol), RateLimitError (HTTP 429 persisted after retries with exponential backoff) and ResponseError (any other unusable response; carries status and reason). download skips failing symbols with a warning unless raise_errors=True.

What is deliberately missing

No price repair heuristics, no quote/info/fundamentals, no caching, no async API. The scope is kept small on purpose.

Development

uv sync
uv run pytest            # offline tests, network is faked
uv run pytest -m live    # one round trip against Yahoo

Metadata

Release files for polars-yahoo 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polars-yahoo 0.2.0
File Size Uploaded Provenance Actions
polars_yahoo-0.2.0.tar.gz 89.0 kB With provenance Details for polars_yahoo-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polars-yahoo 0.2.0
File Interpreter ABI Platform Actions
polars_yahoo-0.2.0-py3-none-any.whl Python 3 none any Details for polars_yahoo-0.2.0-py3-none-any.whl

Total release size: 104.1 kB

Release files / polars_yahoo-0.2.0.tar.gz

Download URL polars_yahoo-0.2.0.tar.gz
Size 89.0 kB
Tags Source
SHA-256 checksum
How to use checksums
86a675e49037b365b4fe32d7e77962f5acc0e81d48e41541b18d8735f21f7655
BLAKE2b-256 checksum
How to use checksums
99515f4bf04c236597e7cf2fd2ef611fc8539b68ac2c0544f274e589cf30489d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / polars_yahoo-0.2.0-py3-none-any.whl

Download URL polars_yahoo-0.2.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
080d60676e4c5241e34741d7abd1f884c92bcbdd5924af54ba68a5b483e7448a
BLAKE2b-256 checksum
How to use checksums
514c1a9dee067cb902cd8a2f304379a9e7afcab8a6feeb1db3eba99ca5367f7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for polars-yahoo 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for polars_yahoo-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page