1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! # tessera
// Brand names read fine without markup; keep the prose clean.
//!
//! The official Rust client for [Tessera](https://tesseralytics.dev) —
//! order-flow-enriched OHLCV, funding-rate, and positioning datasets built
//! from raw Hyperliquid trade data, delivered as Parquet over a REST API.
//!
//! This crate is the Rust mirror of the
//! [`tessera-api`](https://pypi.org/project/tessera-api/) Python SDK: point it
//! at a `(dataset, coin, month)` and read straight from object storage into
//! [Polars](https://pola.rs) or [DuckDB](https://duckdb.org) over presigned
//! URLs — with predicate/projection pushdown, no temp files.
//!
//! ## Choosing a client
//!
//! - [`TesseraClient`] — blocking API. Owns a private tokio runtime, so do not
//! construct it from inside an async runtime.
//! - [`AsyncTesseraClient`] — `async fn` surface for tokio applications.
//!
//! ## Data engines
//!
//! - Polars (default feature `polars`): [`TesseraClient::scan`] returns a
//! `LazyFrame`; [`TesseraClient::read`] collects a `DataFrame`.
//! - DuckDB (opt-in feature `duckdb`): `TesseraClient::to_duckdb` returns an
//! in-memory connection exposing a `tessera` view.
//!
//! ## Plans
//!
//! The free tier covers every coin and all three datasets over the trailing
//! 30 days, served at month granularity (the current and previous calendar
//! month). Closed history is sold as one-off bundles; [`TesseraClient::datasets`]
//! and [`TesseraClient::partitions`] already reflect your entitlement, so the
//! client needs no plan logic of its own.
//!
//! ## Errors
//!
//! Every failure raises [`TesseraError`], mirroring the Python exception
//! taxonomy (`Configuration`, `NotFound`, `PresignExpired`, …).
//!
//! ## Example
//!
//! ```no_run
//! # fn main() -> Result<(), tessera::TesseraError> {
//! let client = tessera::TesseraClient::new(None)?;
//! // Pick the newest available month rather than a hardcoded one:
//! // partitions roll on a trailing 30-day window, so fixed dates go stale.
//! let latest = client
//! .partitions("gold_ohlcv_1m", Some("BTC"), None)?
//! .partitions
//! .pop()
//! .expect("at least one partition");
//! let frame = client.read("gold_ohlcv_1m", "BTC", &latest.month, None)?;
//! println!("{} rows for {}", frame.height(), latest.month);
//! # Ok::<(), tessera::TesseraError>(())
//! # }
//! ```
/// The crate version, as published on crates.io.
pub const VERSION: &str = env!;
/// Data-engine plumbing: Parquet readers for Polars and DuckDB.
///
/// Most users go through [`TesseraClient::scan`] / [`TesseraClient::read`] /
/// `TesseraClient::to_duckdb`; the readers are public for advanced
/// composition over pre-resolved URLs.
pub use crateAsyncTesseraClient;
pub use crateTesseraClient;
pub use crate;
pub use crate;
pub use crate;