Skip to content

analyze, configuration and reports

The typed, immutable API for one-shot analyses. See Configuration and one-shot analysis and Structured reports for how to use it.

analyze

analyze(
    df: DataFrame,
    config: DataConsistencyConfig | None = None,
) -> DataConsistencyReport

Analyze a dataframe and return a structured report in one call.

DataConsistencyConfig dataclass

DataConsistencyConfig(
    iqr_limit: float = 3.5,
    idr_limit: float = 1.0,
    max_combinations: int = 100000,
    verbose: int = 0,
    known_date_cols: tuple[str, ...] = (),
    execute_tests: tuple[str, ...] = (),
    exclude_tests: tuple[str, ...] = (),
    fast_only: bool = False,
    include_code_tests: bool = True,
    freq_contamination_level: int | float = 0.005,
    rare_contamination_level: int | float = 0.1,
    run_parallel: bool = False,
    raise_on_error: bool = False,
)

Configuration for a one-shot data consistency analysis.

to_dict

to_dict() -> dict[str, Any]

Return a JSON-friendly configuration dictionary.

from_dict classmethod

from_dict(
    values: Mapping[str, Any],
) -> DataConsistencyConfig

Build a validated config from a dictionary-like object.

from_file classmethod

from_file(path: str | Path) -> DataConsistencyConfig

Load configuration from JSON or TOML.

DataConsistencyReport dataclass

DataConsistencyReport(
    n_rows: int,
    n_columns: int,
    executed_tests: tuple[str, ...],
    patterns: tuple[dict[str, Any], ...],
    exceptions: tuple[dict[str, Any], ...],
    row_scores: tuple[dict[str, Any], ...],
    execution_failures: tuple[dict[str, Any], ...],
)

Serializable snapshot of one checker analysis state.

to_dict

to_dict() -> dict[str, Any]

Return a strict JSON-safe dictionary representation.

TestMetadata dataclass

TestMetadata(
    test_id: str,
    short_description: str,
    description: str,
    shortlist: bool,
    implemented: bool,
    fast: bool,
    code: bool,
)

Public metadata describing one consistency check.

to_dict

to_dict() -> dict[str, Any]

Return a JSON-safe dictionary representation.