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.
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 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.
Links
- Source, issues and full documentation: https://github.com/delbem-research/damicore
- Licensed under Apache-2.0.
Metadata
Release files for damicore 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| damicore-0.4.0.tar.gz | 40.8 kB | With provenance | Details for damicore-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| damicore-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for damicore-0.4.0-py3-none-any.whl |
Total release size: 86.1 kB
Release files / damicore-0.4.0.tar.gz
| Download URL | damicore-0.4.0.tar.gz |
|---|---|
| Size | 40.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cdfe95d4818379ab7b5730074ee7cd04bf264341030070e45de586f8f277def
|
|
BLAKE2b-256 checksum How to use checksums |
2fa0598f657b0da123da2d7ecb2030ded760d21328b709c61164c141bee153e4
|
| 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 13, 2026.
Transparency logRelease files / damicore-0.4.0-py3-none-any.whl
| Download URL | damicore-0.4.0-py3-none-any.whl |
|---|---|
| Size | 45.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1fbd21c1c569a29c4708e9b2de879111d7d111ff645c9ce19b777b2685cea254
|
|
BLAKE2b-256 checksum How to use checksums |
f5723bb3b0c99ac5b66e499ec055a9fa6a0b0327b38f7786d40a5028184c8fbe
|
| 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 13, 2026.
Transparency logSecurity for damicore 0.4.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.
Attestation for damicore-0.4.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 13, 2026.
Transparency logA 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.