| Crates.io | paracas-fetch |
| lib.rs | paracas-fetch |
| version | 0.3.1 |
| created_at | 2025-12-29 19:29:42.980964+00 |
| updated_at | 2025-12-29 23:04:35.612286+00 |
| description | HTTP client and data fetching for paracas tick data downloader |
| homepage | https://github.com/factordynamics/paracas |
| repository | https://github.com/factordynamics/paracas |
| max_upload_size | |
| id | 2011167 |
| size | 73,535 |
HTTP client and data fetching for the paracas tick data downloader.
The fetch pipeline consists of:
use paracas_fetch::{DownloadClient, ClientConfig, tick_stream};
use paracas_instruments::InstrumentRegistry;
use paracas_types::DateRange;
use futures::StreamExt;
#[tokio::main]
async fn main() {
let client = DownloadClient::new(ClientConfig::default()).unwrap();
let registry = InstrumentRegistry::global();
let instrument = registry.get("eurusd").unwrap();
let range = DateRange::new(
chrono::NaiveDate::from_ymd_opt(2024, 1, 1).unwrap(),
chrono::NaiveDate::from_ymd_opt(2024, 1, 1).unwrap(),
).unwrap();
let mut stream = tick_stream(&client, instrument, range);
while let Some(result) = stream.next().await {
match result {
Ok(tick) => println!("{:?}", tick),
Err(e) => eprintln!("Error: {}", e),
}
}
}
MIT License - see LICENSE for details.