feat: v0.2 — batched quotes (get_quotes/1) and FX (get_fx_rate/2)#3
Merged
Conversation
Two new public functions, both reusing the existing Session +
HTTP wrapper so the cookie + crumb auth flow is unchanged.
YahooFinanceEx.get_quotes/1
- Takes a list of symbols; returns {:ok, %{symbol => result}} where
result is {:ok, Quote.t()} | {:error, :not_found}.
- Internally chunks into batches of 50 (Yahoo's per-request ceiling)
and merges results across batches.
- Dedupes the input list before requesting.
- Top-level errors (auth, transport, http_status) abort the whole
call and bubble up; partial misses surface inside the result map.
YahooFinanceEx.get_fx_rate/2
- Uses Yahoo's <FROM><TO>=X ticker convention internally.
- Identity pairs (USD/USD) short-circuit to {:ok, 1.0} without
hitting the API.
- Returns {:ok, rate} as a float on success.
Version bump 0.1.0 → 0.2.0; README + CHANGELOG updated to match;
package description tightened to reflect actual surface.
7 new tests on top of the 3 existing — 10 passing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two functions on top of v0.1's single-symbol
get_quote/1, both reusing the existing Session + HTTP wrapper.YahooFinanceEx.get_quotes/1{:error, :not_found}for those keys — the top-level call still returns{:ok, map}.YahooFinanceEx.get_fx_rate/2Uses Yahoo's
<FROM><TO>=Xticker convention internally. Returns{:ok, rate}as afloat().Bookkeeping
0.1.0 → 0.2.0.CHANGELOG.mdupdated.README.mdupdated to v0.2 surface, dep snippet bumped to~> 0.2.After merge
Manual step:
mix hex.publishto push 0.2.0. The quantic dep bump + live price column lands in a follow-up PR on the quantic repo.Test plan
mix testclean (10 passing — 3 v0.1 + 7 new)mix compile --warnings-as-errorsclean