Skip to main content

database-whisper

Auto-discovers structural patterns in datasets. Point it at a file, it tells you which fields matter for disambiguation, recommends indexes, and characterizes the structure.

Zero configuration. Zero dependencies (core). Works on CSV, TSV, JSON, SQLite, Excel, Parquet, and SQL dumps.

Install

pip install database-whisper

Optional format support:

pip install openpyxl    # for Excel .xlsx
pip install pyarrow     # for Parquet

Quick start

import database_whisper as dw

report = dw.profile("your_data.csv")
print(report)

Output:

=== Structural Profile: your_data.csv ===
Records: 114,000 | Fields: 20

Structural Density: HIGH (112,871x speedup)
  This dataset has deep categorical structure.

Auto-detected Identity: track_id, track_name, duration_ms

Discriminator Ladder:
  1. track_genre          98.7% reduction  ####################  dominant

Recommended Indexes:
  CREATE INDEX idx_track_genre ON tracks (track_genre);
    -- Standalone index: 99% reduction alone.

Data Quality:
  Ambiguous neighborhoods: 16,641 / 89,741 (18.5%)
  Fully resolved by ladder: YES (100% accuracy)

Structural Fingerprint: SINGLE-AXIS
  One field dominates. Minimal disambiguation depth needed.

What it does

Given any structured dataset, the algorithm:

  1. Auto-detects which fields are identity (primary keys) and which are provenance (record IDs to exclude)
  2. Discovers a discriminator ladder — the ordered sequence of fields that best resolves ambiguity among records sharing the same identity
  3. Measures retrieval speedup vs flat scan and structural density
  4. Recommends database indexes based on the discovered structure
  5. Classifies the dataset by its structural fingerprint (SINGLE-AXIS, DEEP-PIPELINE, ALREADY-UNIQUE, LOW-STRUCTURE)

Supported formats

Format Extension Dependencies
CSV / TSV .csv, .tsv none
JSON (array or nested) .json none
NDJSON .ndjson, .jsonl none
SQLite .db, .sqlite none
SQL dump .sql none
Excel .xlsx openpyxl
Parquet .parquet pyarrow

API

import database_whisper as dw

# Profile a file (auto-detects format)
report = dw.profile("data.csv")
report = dw.profile("data.db")
report = dw.profile("data.xlsx")

# Profile in-memory records
report = dw.profile_records(records, field_names=["col1", "col2", ...])

# Batch router
router = dw.Router()
router.ingest(records, identity_fields=["gene", "disease"])
result = router.query({"gene": "BRAF", "disease": "Melanoma"}, ask_field="therapy")

# Streaming / incremental
live = dw.LiveRouter(identity_fields=["gene", "disease"])
for record in stream:
    event = live.insert(record)

# Memory with sleep consolidation
mem = dw.Memory(identity_fields=["gene", "disease"])
for fact in facts:
    mem.insert(fact)

Tested domains

The algorithm has been validated on 9 datasets across different domains. Same code, different data, different structures discovered.

Domain Records Speedup Accuracy
Oncology (CIViC) 4,825 4,761x 100%
Pharma safety (FAERS) 50,000 7,462x 100%
Weather (NOAA Storm) 50,000 50,000x 100%
Astronomy (NASA Exoplanets) 6,158 6,109x 100%
Seismology (USGS Earthquakes) 20,000 20,000x 100%
Particle physics (CERN CMS) 100,000 100,000x 100%
Music (Spotify) 114,000 112,871x 100%
Astronomy (LSST PLAsTiCC) 7,848 7,848x 100%
Cosmology (LSST CosmoDC2) 50,000 3x 100%

Research

Requirements

Python 3.9+. Core package has zero external dependencies.

License

MIT

Metadata

Release files for database-whisper 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for database-whisper 0.1.0
File Size Uploaded
database_whisper-0.1.0.tar.gz 19.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for database-whisper 0.1.0
File Interpreter ABI Platform
database_whisper-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.2 kB

Release files / database_whisper-0.1.0.tar.gz

Download URL database_whisper-0.1.0.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5ec6e660343cdc028ac456472f609241e5314d08eeef5a44d05d96a24629bc75
BLAKE2b-256 checksum
How to use checksums
ed38e9d7a90136281a3d4fabd7e0faa653d6aa84964f72abe6b5392ef3c993dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / database_whisper-0.1.0-py3-none-any.whl

Download URL database_whisper-0.1.0-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03f99c690b5f26ca449c9610ca5020ff74a7b02177bef6d6405177d15af60b6b
BLAKE2b-256 checksum
How to use checksums
5991c10c6066b64a7e35d0ad1ed2b74b66d5146e23802fa7a6ce72c32a2b4841
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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