invars 0.1.3

Declarative data validation engine using invariants executed on Polars DataFrames.
docs.rs failed to build invars-0.1.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: invars-0.1.4

Quick Example (Polars)

use invars::prelude::*;
use polars::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a DataFrame
    let df = df! {
        "age" => [18, 25, 130],
    }?;

    // Define an invariant: age must be between 0 and 120
    let invariant = Invariant::new(
        "age_between".to_string().try_into()?,
        PolarsKind::ValueBetween,
        Scope::Column { name: "age".into() },
    )
    .with_param("min", "0")
    .with_param("max", "120");

    // Run the engine
    let engine = EnginePolarsDataFrame::default();
    let violations = engine.evaluate(&df, vec![invariant])?;

    // Print violations (optional)
    println!("{:?}", violations);

    Ok(())
}