Skip to main content

PySuricata

Build Status PyPI version Python versions License: MIT codecov Documentation Downloads LinkedIn

PySuricata Logo

Exploratory Data Analysis for Python, Built on Streaming Algorithms

Quick StartDocumentationExamples


What It Does

PySuricata generates self-contained HTML reports from pandas or polars DataFrames. Reports include per-column statistics, histograms, correlation chips, missing value analysis, and outlier detection.

Data is processed in chunks using streaming algorithms, so memory usage stays bounded regardless of dataset size.

Quick Start

Installation

# using uv (recommended)
uv add pysuricata

# or using pip
pip install pysuricata

With polars support (optional):

uv add pysuricata[polars]
# or: pip install pysuricata[polars]

Generate a Report

import pandas as pd
from pysuricata import profile

url = "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv"
df = pd.read_csv(url)

report = profile(df)
report.save_html("titanic_report.html")

▶ See a live example report →

Features

  • Streaming architecture — Data is processed in configurable chunks, keeping memory bounded. Useful for datasets that don't fit in RAM.
  • Pandas and Polars — Works natively with pandas.DataFrame, polars.DataFrame, and polars.LazyFrame.
  • Self-contained HTML — Single file with inline CSS, JS, and SVG charts. No external assets needed.
  • Configurable — Control chunk sizes, sample sizes, sketch parameters, and correlation thresholds via ProfileConfig (aliased as ReportConfig).
  • Reproducible — Seeded random sampling produces deterministic results across runs.
  • CLI tool — Profile datasets from the command line.

How It Works

PySuricata uses well-known streaming algorithms from the academic literature:

Algorithm Purpose Time Space
Welford/Pébay Exact mean, variance, skewness, kurtosis O(1) per value O(1)
KMV sketch Distinct count estimation (~2.2% error) O(log k) per value O(k)
Misra-Gries Top-k frequent values O(1) amortized O(k)
Reservoir sampling Uniform random sample for quantiles O(1) per value O(s)

k = sketch size (default 1024), s = sample size (default 10 000)

All statistics are computed in a single pass over the data.

What's in a Report

Each column is analyzed based on its type:

  • Numeric — Mean, variance, skewness, kurtosis, quantiles, histogram, outlier detection (IQR, MAD, z-score), correlations
  • Categorical — Top values, distinct count, entropy, Gini impurity, string length statistics
  • DateTime — Temporal range, hour/day/month distributions, monotonicity detection
  • Boolean — True/false ratios, entropy, balance score

Plus dataset-level metrics: row/column counts, memory usage, missing value percentages, and duplicate row estimates.

Streaming Large Datasets

Process datasets larger than RAM by passing a generator:

import pandas as pd
from pysuricata import profile

def read_in_chunks():
    for i in range(100):
        yield pd.read_parquet(f"data/part-{i}.parquet")

report = profile(read_in_chunks())
report.save_html("large_report.html")

Statistics Only (No HTML)

Use summarize() for CI/CD quality checks:

from pysuricata import summarize

stats = summarize(df)

assert stats["dataset"]["missing_cells_pct"] < 5.0
assert stats["dataset"]["duplicate_rows_pct_est"] < 1.0

print(f"Mean age: {stats['columns']['age']['mean']:.1f}")

Configuration

from pysuricata import profile, ReportConfig

config = ReportConfig()
config.compute.chunk_size = 250_000
config.compute.random_seed = 42
config.compute.compute_correlations = True
config.compute.corr_threshold = 0.5
config.render.title = "My Analysis"

report = profile(df, config=config)

See the Configuration Guide for all options.

CLI

# Generate HTML report
pysuricata profile data.csv --output report.html

# Get JSON statistics
pysuricata summarize data.csv

Documentation

Contributing

Contributions are welcome. See the Contributing Guide.

git clone https://github.com/alvarodiez20/pysuricata.git
cd pysuricata
uv sync --dev
uv run pytest

License

MIT License. See LICENSE for details.

Acknowledgments

Built using algorithms from:

  • Welford, B.P. (1962) — Streaming moments
  • Pébay, P. (2008) — Parallel merging of moments
  • Bar-Yossef, Z. et al. (2002) — KMV distinct count estimation
  • Misra, J. & Gries, D. (1982) — Streaming heavy hitters

Named after suricatas (meerkats) — small, vigilant animals that work cooperatively and thrive in harsh environments with limited resources.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysuricata-0.1.0.tar.gz (761.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysuricata-0.1.0-py3-none-any.whl (614.7 kB view details)

Uploaded Python 3

File details

Details for the file pysuricata-0.1.0.tar.gz.

File metadata

  • Download URL: pysuricata-0.1.0.tar.gz
  • Upload date:
  • Size: 761.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pysuricata-0.1.0.tar.gz
Algorithm Hash digest
SHA256 423cd957ed044b57649e3b472bbb70fb1ba5e129b2c66ca53fa2d68ffec69665
MD5 2e16bd81347af97cf187341f492b62a2
BLAKE2b-256 467c2d7c8a248cd910a62bbd64ec7f44b618117bd3b8b1676df192eae3db77d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysuricata-0.1.0.tar.gz:

Publisher: cd.yml on alvarodiez20/pysuricata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysuricata-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pysuricata-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 614.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pysuricata-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b456bee139805d9e1653f313e9896eb37a047ce6cbb4e2a19f53c10499742674
MD5 3209b5945809d33d64001a31b8bc4284
BLAKE2b-256 bc53b116703f632303d06c30f8867dccc00a2f2f21781133f60efeb7a1fdcce2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysuricata-0.1.0-py3-none-any.whl:

Publisher: cd.yml on alvarodiez20/pysuricata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

0.0.73

2 files

0.0.72

2 files

0.0.71

2 files

0.0.70

2 files

0.0.68

2 files

0.0.66

2 files

0.0.65

2 files

0.0.64

2 files

0.0.63

2 files

0.0.62

2 files

0.0.61

2 files

0.0.60

2 files

0.0.59

2 files

0.0.58

2 files

0.0.57

2 files

0.0.56

2 files

0.0.55

2 files

0.0.54

2 files

0.0.53

2 files

0.0.52

2 files

0.0.51

2 files

0.0.50

2 files

0.0.49

2 files

0.0.48

2 files

0.0.47

2 files

0.0.46

2 files

0.0.45

2 files

0.0.44

2 files

0.0.43

2 files

0.0.42

2 files

0.0.41

2 files

0.0.40

2 files

0.0.39

2 files

0.0.38

2 files

0.0.37

2 files

0.0.36

2 files

0.0.35

2 files

0.0.34

2 files

0.0.33

2 files

0.0.32

2 files

0.0.31

2 files

0.0.30

2 files

0.0.29

2 files

0.0.28

2 files

0.0.27

2 files

0.0.26

2 files

0.0.25

2 files

0.0.24

2 files

0.0.23

2 files

0.0.22

2 files

0.0.21

2 files

0.0.20

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page