Skip to main content

yf_common/
lib.rs

1//! yf-common: Shared utilities for Yahoo Finance CLI tools
2//!
3//! Provides common functionality:
4//! - Error types and handling
5//! - HTTP client with rate limiting
6//! - Authentication (feature-gated)
7//! - Retry logic with exponential backoff
8//! - Timestamp utilities
9//! - Output writers (JSON, CSV)
10
11pub mod error;
12pub mod rate_limit;
13pub mod client;
14pub mod retry;
15pub mod time;
16pub mod output;
17
18#[cfg(feature = "auth")]
19pub mod auth;
20
21// Re-exports
22pub use error::{Result, YfCommonError};
23pub use rate_limit::{RateLimitConfig, YfRateLimiter};
24pub use client::{YahooClient, YahooClientBuilder};
25pub use retry::{RetryConfig, BackoffStrategy, retry_with_backoff};
26pub use time::{parse_date_to_timestamp, parse_start_date_to_timestamp, timestamp_to_date, today_utc, today_str};
27pub use output::JsonWriter;
28
29#[cfg(feature = "csv")]
30pub use output::CsvWriter;
31
32#[cfg(feature = "auth")]
33pub use auth::{AuthProvider, NoAuth, CrumbAuth};