Skip to main content

damicore

DAMICORE clusters local files, or the rows or columns of a local dataset, without asking you to pick a feature representation or a number of clusters. It serializes each object canonically, measures every pair with exact Normalized Compression Distance (NCD), builds a deterministic Neighbor Joining tree, and cuts communities out of that tree with FastGreedy.

What one object is comes from source_kind, and nothing else changes with it:

source_kind Input One object is
delimited (default) .csv, .tsv, .txt — any single-character delimiter one column, or one row
xlsx an .xlsx/.xlsm worksheet one column, or one row
files files, a directory, or both one file, bytes unchanged

A setting that belongs to another source is rejected rather than ignored: --split on a file corpus, or --delimiter on a worksheet, is a configuration error.

This distribution is the complete pipeline and the only one with a command line. The four stage distributions — damicore-normalizer, damicore-distance, damicore-tree-builder, damicore-clusterizer — are Python APIs that can be installed and used on their own.

pip install damicore

Python

from damicore import ExecutionConfig, ResourceLimits, estimate, load_result, run

# `workers="auto"` opens a process pool whose workers re-import the calling module, so in a
# `.py` script this call must sit under the guard below. A notebook or REPL satisfies it too.
if __name__ == "__main__":
    preview = estimate("dataset.csv", split="columns")
    result = run(
        "dataset.csv",
        split="columns",
        execution=ExecutionConfig(workers="auto", limits=ResourceLimits()),
    )
    result.membership
    result.distance_matrix.head()
    result.close()

    restored = load_result(result.artifacts.run_dir)
    restored.close()

    # A worksheet is the same split read from a workbook. `sheet` names the worksheet and
    # is required when the workbook holds more than one.
    worksheet = run("dataset.xlsx", source_kind="xlsx", split="columns")
    worksheet.close()

    # Files that already are the objects. Nothing is split, so no delimiter or encoding
    # applies; the bytes are adopted as they are, text or binary.
    corpus = run("corpus", source_kind="files")
    corpus.close()

estimate reports the exact cost of a run — objects, pairs, matrix bytes, working memory, free disk, and the bytes the compressor will read — without creating anything. Call it before raising a limit.

The compressor is part of the distance, so choosing it changes the result. The default, compressor="ppmd", is PPMd variant I, the original DAMICORE compressor, which keeps the shared distribution of large objects. "lzma" finds shared content at any size its dictionary holds, "bzip2" sees both within its 900 kB block, and "zlib" and "gzip" see 32 KiB, past which objects look unrelated. Each compressor takes only its own settings — ppmd_order, lzma_dictionary_bytes and the like — and a setting written for another compressor is rejected. pairing="interleave" pairs two objects in blocks of interleave_block_bytes taken in turn, as the original DAMICORE could, so a compressor whose window holds a block pair still matches aligned content of objects larger than the window; pairing="concat", the default, compresses one object after the other.

Command line

damicore estimate dataset.csv --json
damicore run dataset.csv --split columns --output-dir ./results
damicore run dataset.xlsx --source xlsx --sheet measurements --split rows
damicore run ./corpus --source files --no-recursive
damicore run dataset.csv --compressor lzma --lzma-dictionary-bytes 67108864
damicore run ./corpus --source files --compressor zlib --pairing interleave
damicore run one.bin two.bin three.bin --source files
damicore --version

Progress and the artifact paths go to stderr. Only estimate --json writes to stdout, so a shell pipeline reads one JSON document and nothing else.

Exit codes

A failure is also one JSON line on stderr carrying a stable code, so a script can branch on the status and log the reason.

Status Meaning
0 Completed
2 Configuration or input rejected: a setting that does not apply to the source, a malformed dataset, or an unusable file corpus
3 A resource limit would be exceeded
4 A stage or an artifact failed; the code on stderr names which
5 The output directory conflicts, or a checkpoint does not match
130 Interrupted; the run is resumable
141 Terminated by a broken pipe (the SIGPIPE convention), e.g. when piping to head

Results

A run writes a versioned, hash-verified directory: the distance matrix as a float64 .npy memory map, the tree as JSON and Newick, cluster membership as CSV and JSON, plus a manifest and a report. load_result reopens it, and an interrupted run resumes from its checkpoints to the same bytes a fresh run would have produced.

Scale

The exact algorithm accepts at most 1,000 objects, 500,000 pairs and 512 MiB per matrix by default. What decides feasibility is how many objects the source produces, not how many bytes it holds: a multi-gigabyte dataset with tens of columns is feasible, the same file split into millions of rows is not, and a file corpus is bounded by its file count. Either way the run is rejected during preflight rather than after hours of work.

Call estimate before raising a limit — it reports the exact cost without creating anything. The complexity behind the gates is documented in scalability.

Metadata

Release files for damicore 0.7.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 damicore 0.7.0
File Size Uploaded Provenance Actions
damicore-0.7.0.tar.gz 45.3 kB With provenance Details for damicore-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for damicore 0.7.0
File Interpreter ABI Platform Actions
damicore-0.7.0-py3-none-any.whl Python 3 none any Details for damicore-0.7.0-py3-none-any.whl

Total release size: 95.2 kB

Release files / damicore-0.7.0.tar.gz

Download URL damicore-0.7.0.tar.gz
Size 45.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e5bf0df3de6af18831bf23a81d60bc861fcd71a8121eab4f5e22d13c4158292c
BLAKE2b-256 checksum
How to use checksums
bc46afe6bf069bb954004420a882ece74ea5e24ec78fe77284b2722b4afebc9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / damicore-0.7.0-py3-none-any.whl

Download URL damicore-0.7.0-py3-none-any.whl
Size 49.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
305e9eedfb5d1ba393796bfe3c731161a3203fd35be3fb9e7dd8cb53ee4cfc36
BLAKE2b-256 checksum
How to use checksums
e72a76f47b58583814d73803be3ee34e58a2556d87db3de0ed87a984b21ef1e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for damicore 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for damicore-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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