go-yfinance v1.4.0 Development Progress
Last Updated: 2026-05-24
Overview
Implementation plan and progress tracking for Python yfinance v1.4.0 parity. This release focuses on authentication, locale/region scoping, market endpoint correctness, and history/repair stability fixes rather than a large new data surface.
Branch Structure
Changes from Python yfinance v1.3.0 -> v1.4.0
| Upstream PR | Python Change | Go Status |
|---|---|---|
| #2761 | Add yf.Auth for manually supplied Yahoo T/Y login cookies |
Done: added login-cookie setting, user parsing, and cookie merge support |
| #2803 | Add ISO alpha-2 region scoping to Sector and Industry |
Done: added WithRegion options and normalized region scoping |
| #2802 | Allow curl_cffi fallback to requests |
Not directly applicable; evaluate optional net/http fallback separately |
| #2804 | Add global locale config for v7/v10 ticker endpoints | Done: added config.SetLocale and propagated lang/region to ticker v7/v10, lookup, and calendars endpoints |
| #2801 | Validate market regions and avoid misleading non-US status | Done: added MarketRegion, normalized legacy market inputs, and switched market APIs to market params |
| #2805 | Make Python download() reentrant by removing shared globals |
Mostly not applicable; Go already uses per-call result maps |
| #2825 | Preserve localized intraday download timezone | Planned review: add opt-in exchange-timezone localization if needed |
| #2777 | Preserve repair choice in history_metadata() |
Done: connected HistoryParams.Repair to Go repair pipeline |
| #2778 / #2794 | Harden history parsing for malformed or null chart payloads | Planned: add defensive parsing tests and typed errors |
| #2780 | Fix 1-month interval comparison across years | Planned review for analogous Go interval logic |
| #2797 | Fix dividends on unlisted tickers | Planned: verify empty/missing chart action behavior |
| #2810 | Simplify phantom-dividend repair and remove ticker allowlist | Planned: compare Go dividend repair behavior and tests |
| #2821 | Drop frozendict hard dependency |
Python-only dependency cleanup; not applicable |
| #2779 / #2792 | Typo and test maintenance | Not applicable unless docs/tests share wording |
Python yfinance v1.4.1 Review
| Upstream PR | Python Change | Go Status |
|---|---|---|
| #2832 | Preserve Date/Datetime pandas index name in yf.download() output |
Not applicable: Go returns map[string][]models.Bar and stores timestamps in models.Bar.Date, with no pandas index metadata |
Implementation Plan
Phase 1: Locale and Market Correctness
- Add thread-safe locale fields to
pkg/configwith defaultsen-USandUS. - Propagate locale to v7/v10 quote, quoteSummary, info, calendar, lookup, and calendars endpoints where applicable.
- Add
models.MarketRegionvalues matching Python v1.4.0. - Recheck
pkg/marketrequest parameters: Python usesmarket, while current Go code sendsregion. - Return an explicit unavailable status for non-US markettime responses that Yahoo answers with U.S. data.
Phase 2: Sector and Industry Region Scoping
- Add
WithRegion(region string)options topkg/sectorandpkg/industry. - Normalize region with
strings.TrimSpaceandstrings.ToUpper. - Preserve default U.S. behavior.
- Add tests proving region appears in request params and cache behavior remains per instance.
Phase 3: Manual Yahoo Login Cookies
- Add a public API for setting Yahoo login cookies
TandY. - Change client cookie storage from a single raw cookie string to mergeable named cookies.
- Add
CheckLogin()support by parsing Yahoo Finance'snimbus-benji-configuser payload. - Ensure login cookies and crumb/cookie authentication coexist without overwriting each other.
Phase 4: History and Repair Stability
- Harden chart parsing for
chart=null,result=null, missing quote payloads, and Yahoo error payloads. - Decide whether
HistoryParams.Repairshould runpkg/repairautomatically; implement or document explicitly. - Review intraday timestamp behavior and add opt-in local exchange timezone conversion if it aligns with Go API expectations.
- Compare Python v1.4.0 repair changes with Go repair logic, especially phantom dividends and zero-volume statistics.
Phase 5: Documentation and Verification
- Add
docs/releases/RELEASE_NOTES_v1.4.0.md. New release notes should live underdocs/releases/, not the repository root. - Update README and docs index/navigation.
- Regenerate API docs if public APIs change.
- Run
go test ./...; run broader checks if available.
Verification Plan
| Check | Status |
|---|---|
| Unit tests for locale config and endpoint params | Partial PASS: go test ./pkg/config ./pkg/ticker ./pkg/calendars ./pkg/lookup |
| Unit tests for market validation/status mismatch | PASS: go test ./pkg/market |
| Unit tests for sector/industry region options | PASS: go test ./pkg/sector ./pkg/industry |
| Unit tests for login cookie merge and login parsing | PASS: go test ./pkg/client |
| Unit tests for malformed chart responses | Follow-up: deeper fixture coverage is still useful; existing chart parsing remains defensive |
go test ./... |
PASS: GOCACHE=/tmp/go-build-cache go test ./... |
go vet ./... |
PASS: GOCACHE=/tmp/go-build-cache go vet ./... |
golangci-lint run --timeout=5m ./... |
PASS: GOCACHE=/tmp/go-build-cache GOLANGCI_LINT_CACHE=/tmp/golangci-lint-cache golangci-lint run --timeout=5m ./... |
| Race tests | PASS: GOCACHE=/tmp/go-build-cache go test -race ./... |
| Coverage report | PASS: GOCACHE=/tmp/go-build-cache go test -coverprofile=coverage.out ./...; total statement coverage 42.9% |
| Go Report Card CLI | Not run locally: goreportcard-cli is not installed; local substitutes above are clean |
Python vs Go Call Structure Notes
- Python uses
YfDataas a process-wide singleton with a shared session/cookie jar. Go keeps explicitclient.Clientinstances andAuthManagervalues, which is more idiomatic for resource ownership and caller-controlled sharing. - Python
Auth.set_login_cookies(T, Y)writes to the session cookie jar. GoAuthManager.SetLoginCookies(T, Y)writes mergeable named cookies intoclient.Client; this preserves crumb cookies instead of replacing the whole cookie header. - Python
Auth.check_login()parses thenimbus-benji-configscript and returnsFalseor raises depending on debug config. GoCheckLogin()parses the same script but returns(bool, error), which is the Go-native way to expose parse/network failures. - Python
Market(MarketRegion.X)validates enum values and sendsmarket=<value>to both market summary and markettime. Go mirrors the endpoint parameter and addsNewWithRegion(models.MarketRegionX)while retaining legacyus_marketaliases for compatibility. - Python
Sector/Industryacceptregionin the constructor and call/v1/finance/sectors|industries/{key}withformatted=true,withReturns=true,lang=en-US, andregion=<region>. Go mirrors the endpoint shape, but expresses region asWithRegion(...)because the package already uses functional options. - Python keeps the domain endpoint
langfixed aten-US. Go intentionally defaults toen-USbut allows callers to override it throughconfig.SetLocale, applying the same locale behavior consistently across Yahoo endpoints that acceptlang.
Change History
| Date | Description |
|---|---|
| 2026-05-24 | Branch created and Python v1.4.0 diff reviewed |
| 2026-05-24 | Added locale config and propagated locale params to ticker, lookup, and calendars |
| 2026-05-24 | Added MarketRegion support and corrected market summary/status request params |
| 2026-05-24 | Added Sector and Industry region scoping options |
| 2026-05-24 | Added manual Yahoo login cookie support and login user parsing |
| 2026-05-24 | Connected HistoryParams.Repair to the repair package |
| 2026-05-24 | Rechecked Python v1.4.0 call structure; documented Go's intentional locale customization for Sector/Industry domain lang |
| 2026-05-24 | Verified go vet, golangci-lint, race tests, and coverage report |