Skip to content

Quickstart

Iman edited this page Jun 21, 2026 · 1 revision

The one function you need

Everything in tsauditor goes through a single entry point:

import tsauditor as tsa
 
report = tsa.scan(df, target="Direction", domain="finance")

scan() returns a GuardReport object. From there, you decide what to do with the findings.


Minimal example

import pandas as pd
import tsauditor as tsa
 
# Load your time-series DataFrame
df = pd.read_csv("data.csv", index_col="Date", parse_dates=True)
 
# Run the audit
report = tsa.scan(df, target="Direction", domain="finance")
 
# Print a formatted summary to the terminal
report.summary()

If your datetime column isn't already the index, pass it via time_col:

report = tsa.scan(df, target="Direction", time_col="Date", domain="finance")

Reading the report

Print to terminal

report.summary()

Prints a colour-coded table showing every issue found, grouped by severity, with suggested actions below.

Access issues programmatically

# Issues that block modeling — fix these first
report.critical
 
# Issues worth reviewing
report.warnings
 
# Informational findings
report.info
 
# All issues, sorted by severity
report.all_issues

Filter by code, module, or severity

# All leakage issues
report.filter(module="leakage")
 
# Specific issue code
report.filter(code="LEK001")
 
# All critical issues from the profiler
report.filter(module="profiler", severity="critical")

Get columns flagged for leakage

# Returns a list of column names to review or remove
report.leaky_columns()

Export to JSON

report.to_json("report.json")

The JSON file contains the full issue list with evidence and suggested actions, suitable for logging in automated pipelines.


Sensor data example

import pandas as pd
import tsauditor as tsa
 
df = pd.read_csv("sensor_log.csv", index_col="timestamp", parse_dates=True)
 
# No target needed for structural + anomaly checks only
report = tsa.scan(df, domain="sensor")
report.summary()

Selective module runs

Run only the checks you need:

# Only structural profiling, skip anomaly and leakage
report = tsa.scan(df, run_anomaly=False, run_leakage=False)
 
# Only leakage detection
report = tsa.scan(df, target="label", run_profiler=False, run_anomaly=False)

Next steps

Clone this wiki locally