Skip to main content

Crate adaq_data_stock_us

Crate adaq_data_stock_us 

Source
Expand description

§adaq-data-stock-us

A Rust reimplementation of Python’s yfinance for fetching US equity market data from Yahoo Finance.

  • Canonical return types are strongly-typed structs (compile-time guarantees); tabular consumers can convert via History::to_polars() (feature polars) or serde (JSON, always on). See docs/adr/0002-typed-struct-canonical.md.
  • HTTP uses primp with Chrome TLS impersonation to avoid Yahoo rate-limiting. See docs/adr/0001-async-primp.md.
  • Async-first, with a blocking facade for non-async callers.
use adaq_data_stock_us::{Client, HistoryOptions, Interval};
let client = Client::new()?;
let hist = client.history("AAPL", &HistoryOptions::default()).await?;
println!("bars: {}", hist.bars.len());

Re-exports§

pub use auth::Auth;
pub use calendars::CalendarColumn;
pub use calendars::CalendarOperand;
pub use calendars::CalendarQuery;
pub use calendars::CalendarResult;
pub use calendars::EarningsEvent;
pub use calendars::EconomicEvent;
pub use calendars::IpoEvent;
pub use calendars::SplitEvent;
pub use client::Client;
pub use client::DownloadResult;
pub use client::Ticker;
pub use client::TickerId;
pub use client::download;
pub use config::Config;
pub use earnings::EarningsDate;
pub use error::Result;
pub use error::YfError;
pub use fundamentals::Financials;
pub use fundamentals::Freq;
pub use fundamentals::Statement;
pub use history::Actions;
pub use history::Bar;
pub use history::CapitalGain;
pub use history::Dividend;
pub use history::History;
pub use history::HistoryMeta;
pub use history::HistoryOptions;
pub use history::Interval;
pub use history::Split;
pub use http::YfSession;
pub use isin::isin_for_ticker;
pub use isin::resolve_isin;
pub use live::LiveWebSocket;
pub use live::PricingData;
pub use lookup::LookupResult;
pub use lookup::LookupRow;
pub use mic::MIC_TO_YAHOO_SUFFIX;
pub use mic::is_isin;
pub use mic::mic_to_suffix;
pub use mic::resolve_symbol;
pub use news::NewsArticle;
pub use options::ExpirationOptions;
pub use options::OptionChain;
pub use options::OptionContract;
pub use quote::AnalystPriceTargets;
pub use quote::Calendar;
pub use quote::FastInfo;
pub use quote::FundHolding;
pub use quote::FundsData;
pub use quote::HolderRow;
pub use quote::Holders;
pub use quote::Info;
pub use quote::NamedTable;
pub use quote::RecommendationTrend;
pub use quote::SecFiling;
pub use quote::Sustainability;
pub use quote::UpgradesDowngrades;
pub use screener::ETFQuery;
pub use screener::EquityQuery;
pub use screener::FundQuery;
pub use screener::Operand;
pub use screener::Operator;
pub use screener::Query;
pub use screener::QueryKind;
pub use screener::ScreenOptions;
pub use screener::ScreenerQuery;
pub use screener::ScreenerQuote;
pub use screener::ScreenerResult;
pub use screener::ScreenerValue;
pub use search::SearchNews;
pub use search::SearchQuote;
pub use search::SearchResult;

Modules§

auth
Authentication (mirrors yfinance’s Auth): inject the Yahoo T/Y login cookies and inspect the resulting subscription entitlement.
blocking
Blocking (synchronous) facade over the async crate::Client.
cache
On-disk sqlite cache for persisted data (crumb, ticker→timezone, isin→ticker).
calendars
Calendars (mirrors yfinance’s Calendars): earnings / IPO / economic / splits, served by the v1/finance/visualization endpoint.
client
The main Client entry point and the Ticker handle, plus the blocking facade. Mirrors yfinance’s Ticker + module-level download().
config
Runtime configuration for sessions and clients.
domain
Domain objects: Sector, Industry, Market (mirrors yfinance’s domain/ package).
earnings
Per-ticker earnings dates (mirrors Ticker.get_earnings_dates).
error
Error types for the yfinance Rust port.
fundamentals
Financial statements: income / balance-sheet / cash-flow.
history
Price history: typed History/Bar parsed from the v8/finance/chart endpoint, with dividend/split adjustment and corporate actions.
http
HTTP session: the YfSession is the shared, thread-safe core that owns the impersonating HTTP client, cookie/consent bootstrap, crumb, retry/backoff, and the sqlite cache. Mirrors yfinance’s YfData singleton.
isin
ISIN ↔ ticker resolution.
json
Centralised JSON value accessors for Yahoo Finance responses.
live
Live streaming (mirrors yfinance’s live): a WebSocket price stream from streamer.finance.yahoo.com, decoding the PricingData protobuf frames.
lookup
Lookup (mirrors yfinance’s Lookup).
mic
Market Identifier Code (MIC) → Yahoo Finance suffix mapping and ISIN detection.
news
Per-ticker news feed (mirrors Ticker.get_news).
options
Options chain (mirrors yfinance’s Ticker.option_chain).
quote
quoteSummary family: info, fast_info, holders, analysis, sustainability, funds, and calendar endpoints.
screener
Screener (mirrors yfinance’s screener package): the EquityQuery / FundQuery / ETFQuery query-builder DSL plus screen() against Yahoo’s screener endpoints.
search
Search (mirrors yfinance’s Search).

Functions§

block_on
Run a future to completion on a shared multi-thread runtime. Used by the blocking facade.