Skip to main content

Crate mtgjson_sdk

Crate mtgjson_sdk 

Source
Expand description

MTGJSON SDK for Rust.

Provides a high-level client for querying the complete MTGJSON dataset. Data is downloaded from the MTGJSON CDN as parquet and JSON files, cached locally, and queried in-process via DuckDB.

§Quick start

use mtgjson_sdk::MtgjsonSdk;

let mut sdk = MtgjsonSdk::builder().build().unwrap();

// Query cards
let cards = sdk.cards().get_by_name("Lightning Bolt", None).unwrap();

// Open a draft booster
let pack = sdk.booster().open_pack("MH3", "draft").unwrap();

Re-exports§

pub use cache::CacheManager;
pub use connection::Connection;
pub use error::MtgjsonError;
pub use error::Result;
pub use sql_builder::SqlBuilder;

Modules§

booster
cache
Version-aware CDN download and local file cache manager.
config
connection
DuckDB connection wrapper with view registration and query execution.
error
models
queries
Query modules for the MTGJSON SDK.
sql_builder
SQL builder with parameterized query construction.

Structs§

MtgjsonSdk
The main entry point for the MTGJSON SDK.
MtgjsonSdkBuilder
Builder for configuring and constructing an MtgjsonSdk instance.

Type Aliases§

ProgressCallback
Callback for download progress reporting.